Commit 488ce5e1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 47fbed49
......@@ -719,7 +719,6 @@ def watch(twlink, zf, at): # XXX -> ?
pinv.append('%d: %s' % (blk, s))
return '{%s}' % ', '.join(pinv)
pin_prev = {}
if at_prev is not None:
assert at_prev <= at, 'TODO %s -> %s' % (t.hat(at_prev), t.hat(at))
......@@ -751,11 +750,19 @@ def watch(twlink, zf, at): # XXX -> ?
#print('-> %s' % pinstr(pin))
# {} blk -> at that have to be pinned
# {} blk -> at that have to be pinned.
# XXX also check that head/file[blk] is in cache - else no need to pin
pinok = pin
print('# pinok: %s' % pinstr(pinok))
twlink._watch(zf, at, pinok, "ok")
# _watch sends watch request for zf@at, expects initial pins specified by pinok, and finaly reply.
#
# pinok: {} blk -> at that have to be pinned.
@func(tWatchLink)
def _watch(twlink, zf, at, pinok, reply):
# send watch request and check that we receive pins for in-cache blocks
# changed > at. Use timeout to detect wcfs replying less pins than expected.
#
......@@ -781,7 +788,7 @@ def watch(twlink, zf, at): # XXX -> ?
wg.go(_)
def _(ctx):
assert twlink.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at))) == "ok"
assert twlink.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at))) == reply
# cancel _expectPin waiting upon receiving "ok" from wcfs
# -> error that missed pins were not received.
cancel()
......@@ -918,8 +925,7 @@ def test_wcfs():
# watch with @at < δtail.tail -> rejected
print('\n\nAAA\n\n')
wl = t.openwatch()
assert wl.sendReq(timeout(), b"watch %s @%s" % (h(zf._p_oid), h(p64(u64(at0)-1)))) == \
"XXX"
wl._watch(zf, p64(u64(at0)-1), {}, "errXXX")
wl.close()
return # XXX
......
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