Commit 381ce6b2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5d7f9718
......@@ -882,12 +882,12 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str)
ev.append('pin ack pre') # XXX +details?
for p in pinv:
p.reply(b"ack")
# check that we don't get extra pins before reply to "watch"
# check that we don't get extra pins before f completes
try:
req = wlink.recvReq(ctx)
except Exception as e:
if e is context.canceled:
return # cancel is expected after seeing "ok"
return # cancel is expected after f completes
reraise(e, None, e.__traceback__)
assert False, "extra pin message received: %r" % req.msg
......@@ -1098,58 +1098,6 @@ def test_wcfs():
ev = doCheckingPin(_, {wl: (zf, pinok)})
"""
# XXX dup wrte tWatchLink._watch
def _(ctx):
pinv = wl._expectPin(ctx, zf, pinok)
ev.append('pin rx')
tdelay() # XXX doc
ev.append('pin ack pre')
for p in pinv:
p.reply("ack")
# check that we don't get extra pins before read wakeup
try:
req = wl.recvReq(ctx)
except Exception as e:
if e is context.canceled:
return # cancel is expected after seeing "ok"
reraise(e, None, e.__traceback__)
assert False, "extra pin message received: %r" % req.msg
wg.go(_)
def _(ctx):
assert f.cached()[blk] == 0
ev.append('read pre')
# access data with released GIL so that the thread that reads data from
# head/watch can receive pin message. Be careful to handle cancelation,
# so that on error in another worker we don't stuck and the error is
# successfully propagated to wait and reported.
have_read = chan(1)
def _():
b = read0_nogil(blk_data)
have_read.send(b)
go(_)
_, _rx = select(
ctx.done().recv, # 0
have_read.recv, # 1
)
if _ == 0:
raise ctx.err()
b = _rx
ev.append('read ' + chr(b))
# cancel _expectPin waiting upon waking up from read from wcfs
# -> error that missed pins were not received.
cancel()
wg.go(_)
wg.wait()
"""
assert ev == ['read pre', 'pin rx', 'pin ack pre', 'read 4'] # 4 - read @head # XXX depend on blk
assert f.cached()[blk] > 0
......
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