Commit fac36e13 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 723388c4
......@@ -544,6 +544,7 @@ class tWatch:
req = t.recvReq(ctx)
except Exception as e:
raise RuntimeError("%s\nnot all pin missages received - pending:\n%s" % (e, expected))
assert False # XXX temp
assert req is not None # channel not closed
assert req.msg in expected
expected.remove(req.msg)
......@@ -658,6 +659,7 @@ def test_wcfs():
print('\n\n inv. protocol \n\n')
w = t.openwatch()
"""
ctx = context.background() # XXX stub
wg = sync.WorkGroup(ctx)
......@@ -670,6 +672,7 @@ def test_wcfs():
assert w.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at1))) == "ok"
wg.go(_)
wg.wait()
"""
print('\nCCC\n')
bg = context.background()
......@@ -677,7 +680,7 @@ def test_wcfs():
# checkSetupWatch verifies setting up new watch for zf@at.
def checkSetupWatch(zf, at):
print('C: check setup watch f%s %s' % (h(zf._p_oid), t.hat(at)))
print('C: check setup watch f<%s> %s' % (h(zf._p_oid), t.hat(at)))
# all changes to zf
vdf = [_.byfile[zf] for _ in t.dFtail if zf in _.byfile]
......@@ -710,12 +713,21 @@ def test_wcfs():
for p in pinv:
p.reply(b"ack")
wg.go(_)
assert w.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at))) == "ok"
# cancel expectPin waiting upon receiving "ok" from wcfs
# -> error that missed pins were not received.
cancel()
wg.wait()
def _(ctx):
assert w.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at))) == "ok"
# cancel expectPin waiting upon receiving "ok" from wcfs
# -> error that missed pins were not received.
cancel()
wg.go(_)
try:
wg.wait()
except:
import traceback
traceback.print_exc()
raise
# XXX for zf: check all revisions, even if zf was not changed in rev
for dF in t.dFtail:
for zf in dF.byfile:
checkSetupWatch(zf, dF.rev)
......
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