Commit 5ba816da authored by Kirill Smelkov's avatar Kirill Smelkov

X restore test_wcfs_watch_robust after f05271b1.

parent 30553e72
......@@ -85,7 +85,7 @@ error _WatchLink::closeWrite() {
// XXX vvv should be ~ shutdown(TX, wlink._f), however shutdown does
// not work for non-socket file descriptors. And even if we dup link
// fd, and close only one used for TX, peer's RX will still be blocked
// ad fds are referring to one file object which stays in opened
// as fds are referring to one file object which stays in opened
// state. So just use ^^^ "bye" as "TX closed" message.
// wlink._wtx.close();
});
......
......@@ -1647,7 +1647,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
continue
}
toPin[blk], _ = f.LastBlkRev(ctx, blk, at)
toPin[blk], _ = f.LastBlkRev(ctx, blk, at) // XXX err
}
}
......
......@@ -1235,9 +1235,16 @@ def test_wcfs_watch_robust():
wl = t.openwatch()
wg = sync.WorkGroup(timeout())
def _(ctx):
assert wl.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at1))) == \
"error setup watch f<%s> @%s: " % (h(zf._p_oid), h(at1)) + \
"pin #%d @%s: context canceled" % (2, h(at1))
# TODO clarify what wcfs should do if pin handler closes wlink TX:
# - reply error + close, or
# - just close
# t = when reviewing WatchLink.serve in wcfs.go
#assert wl.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at1))) == \
# "error setup watch f<%s> @%s: " % (h(zf._p_oid), h(at1)) + \
# "pin #%d @%s: context canceled" % (2, h(at1))
with raises(RuntimeError, match="unexpected EOF"):
wl.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at1)))
wg.go(_)
def _(ctx):
req = wl.recvReq(ctx)
......
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