Commit fac36e13 authored by Kirill Smelkov's avatar Kirill Smelkov

.

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