Commit 8689314b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8c05bc4c
......@@ -846,7 +846,7 @@ def _watch(twlink, zf, at, pinok, replyok):
assert reply[:len(rok)] == rok
else:
assert reply == replyok
doCheckingPin(_, {twlink: pinok})
doCheckingPin(_, {twlink: (zf, pinok)})
twlink._watching[zf] = at
......@@ -855,7 +855,7 @@ def _watch(twlink, zf, at, pinok, replyok):
# time f executes.
#
# f(ctx) # XXX + ev?
# pinokByWLink: {} tWatchLink -> {} blk -> at.
# pinokByWLink: {} tWatchLink -> (zf, {} blk -> at).
# pinfunc(wlink, foid, blk, at) | None. XXX foid -> ZBigFile?
#
# pinfunc is called after pin request is received from wcfs but before pin ack
......@@ -870,9 +870,9 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None):
ctx, cancel = with_timeout()
wg = sync.WorkGroup(ctx)
for wlink, pinok in pinokByWLink.items():
for wlink, (zf, pinok) in pinokByWLink.items():
def _(ctx, wlink):
pinv = wlink._expectPin(ctx, zf, pinok) # XXX zf?
pinv = wlink._expectPin(ctx, zf, pinok)
tdelay() # increase probability to receive erroneous extra pins
for p in pinv:
if pinfunc is not None:
......@@ -1067,6 +1067,7 @@ def test_wcfs():
blk_data = f.blk(blk)
assert f.cached()[blk] == 0
ev = []
def _(ctx):
assert f.cached()[blk] == 0
ev.append('read pre')
......@@ -1089,13 +1090,12 @@ def test_wcfs():
b = _rx
ev.append('read ' + chr(b))
doCheckingPin(_, {wl: pinok})
doCheckingPin(_, {wl: (zf, pinok)})
"""
# XXX dup wrte tWatchLink._watch
ev = []
def _(ctx):
pinv = wl._expectPin(ctx, zf, pinok)
ev.append('pin rx')
......
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