Commit 68cad21b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 27d34296
...@@ -1270,20 +1270,21 @@ def test_wcfs_inv_watch_robust(): ...@@ -1270,20 +1270,21 @@ def test_wcfs_inv_watch_robust():
t = tDB(); zf = t.zfile t = tDB(); zf = t.zfile
defer(t.close) defer(t.close)
t.change(zf, {2:'c1'} t.change(zf, {2:'c1'}); at1 = t.commit()
t.change(zf, {2:'c2'}); at2 = t.commit()
# closeTX/bye cancels blocked pin handlers # closeTX/bye cancels blocked pin handlers
wl = t.openwatch() wl = t.openwatch()
wg = sync.WorkGroup(timeout()) wg = sync.WorkGroup(timeout())
def _(ctx): def _(ctx):
assert wl.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at2))) == \ assert wl.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at1))) == \
"error setup watch f<%s> @%s: pin #%d @%s: context canceled" % \ "error setup watch f<%s> @%s: pin #%d @%s: context canceled" % \
(h(zf._p_oid), h(at2), 2, h(at2)) (h(zf._p_oid), h(at1), 2, h(at1))
wg.go(_) wg.go(_)
def _(ctx): def _(ctx):
req = wl.recvReq(ctx) req = wl.recvReq(ctx)
assert req is not None assert req is not None
assert req.msg == b"pin %s #%d @%s" % (h(zf._p_oid), 2, h(at2)) assert req.msg == b"pin %s #%d @%s" % (h(zf._p_oid), 2, h(at1))
# don't reply to req - close instead # don't reply to req - close instead
wl._closeTX() wl._closeTX()
wg.go(_) wg.go(_)
...@@ -1292,7 +1293,7 @@ def test_wcfs_inv_watch_robust(): ...@@ -1292,7 +1293,7 @@ def test_wcfs_inv_watch_robust():
# NOTE if wcfs.go does not fully cleanup this canceled watch and leaves it # NOTE if wcfs.go does not fully cleanup this canceled watch and leaves it
# in half-working state, it will break on further commit, as pin to the # in half-working state, it will break on further commit, as pin to the
# watch won't be handled. # watch won't be handled.
# TODO -> add explicit check for ^^^ if/when moved to separate test. XXX t.change(zf, {2:'c3'}); at3 = t.commit()
# invalid requests -> wcfs replies error # invalid requests -> wcfs replies error
wl = t.openwatch() wl = t.openwatch()
......
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