Commit 6dc5272d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 82f13653
...@@ -136,9 +136,11 @@ def timeout(parent=context.background()): # -> ctx ...@@ -136,9 +136,11 @@ def timeout(parent=context.background()): # -> ctx
ctx, _ = with_timeout() ctx, _ = with_timeout()
return ctx return ctx
# XXX # tdelay is used in places where we need to delay a bit in order to e.g. raise
# probability of a bug due to race condition.
def tdelay(): def tdelay():
time.sleep(1*time.millisecond) # XXX -> 10ms ? time.sleep(10*time.millisecond)
# DF represents a change in files space. # DF represents a change in files space.
# it corresponds to ΔF in wcfs.go . # it corresponds to ΔF in wcfs.go .
...@@ -163,9 +165,19 @@ class DFile: ...@@ -163,9 +165,19 @@ class DFile:
# BigFiles opened under tDB are represented as tFile - see .open for details. # BigFiles opened under tDB are represented as tFile - see .open for details.
# Watches opened under tDB are represented as tWatchLink - see .openwatch for details. # Watches opened under tDB are represented as tWatchLink - see .openwatch for details.
# #
# XXX .root + .wc
#
# XXX .change + .commit
# XXX .dFtail + .head
# + .iter_revv
#
# XXX .open -> .topen # XXX .open -> .topen
# XXX .openwatch -> .topenwatch ? # XXX .openwatch -> .topenwatch ?
# #
# XXX .close
#
# XXX .path/.read/.stat/._open
#
# XXX print -> t.trace/debug() + t.verbose depending on py.test -v -v ? # XXX print -> t.trace/debug() + t.verbose depending on py.test -v -v ?
class tDB: class tDB:
def __init__(t): def __init__(t):
...@@ -649,7 +661,7 @@ class tWatch: ...@@ -649,7 +661,7 @@ class tWatch:
# tWatchLink provides testing environment for /head/watch link opened on wcfs. # tWatchLink provides testing environment for /head/watch link opened on wcfs.
# #
# .sendReq()/.recvReq() provides raw IO in terms of wcfs invalidation protocol messages. # .sendReq()/.recvReq() provides raw IO in terms of wcfs invalidation protocol messages.
# .watch() setups/adjusts a watch for a file and verifies that wcfs sends correct initial pins. # .watch() setups/adjusts a watch for a file and verifies that wcfs correctly sends initial pins.
class tWatchLink: class tWatchLink:
def __init__(t, tdb): def __init__(t, tdb):
...@@ -927,7 +939,7 @@ def _pinAt(t, zf, at): # -> pin = {} blk -> rev ...@@ -927,7 +939,7 @@ def _pinAt(t, zf, at): # -> pin = {} blk -> rev
# pinok: {} blk -> rev # pinok: {} blk -> rev
# pinok can be None - in that case it is computed automatically. # pinok can be None - in that case it is computed automatically.
@func(tWatchLink) @func(tWatchLink)
def watch(twlink, zf, at, pinok=None): # XXX -> ? def watch(twlink, zf, at, pinok=None): # XXX -> tWatch ?
t = twlink.tdb t = twlink.tdb
w = twlink._watching.get(zf) w = twlink._watching.get(zf)
if w is None: if w is None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment