Commit 7221cb5a authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 21e6e206
......@@ -914,6 +914,7 @@ def watch(twlink, zf, at, pinok=None): # XXX -> ?
if at_prev is not None:
assert at_prev <= at, 'TODO %s -> %s' % (t.hat(at_prev), t.hat(at))
pin_prev = twlink._pinAt(zf, at_prev)
assert w.pinned == pin_prev
pin = twlink._pinAt(zf, at)
......@@ -953,6 +954,7 @@ def watch(twlink, zf, at, pinok=None): # XXX -> ?
twlink._watch(zf, at, pinok, "ok")
w.at = at
assert w.pinned == twlink._pinAt(zf, at)
# _watch sends watch request for zf@at, expects initial pins specified by pinok and final reply.
#
......@@ -1218,6 +1220,12 @@ def test_wcfs():
# watched + commit -> read -> receive pin messages; read is stuck until pins are acknowledged
wl3 = t.openwatch(); wl3.watch(zf, at3); assert at3 == t.head
assert set(wl3._watching.keys()) == {zf}
w3 = wl3._watching[zf]
assert w3.foid == zf._p_oid
assert w3.at == at3
assert w3.pinned == {}
wl3_ = t.openwatch(); wl3_.watch(zf, at3)
wl2 = t.openwatch(); wl2.watch(zf, at2)
f.assertCache([1,1,1,1])
......
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