Commit c64141e4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent dca9770a
...@@ -528,7 +528,6 @@ class tFile: ...@@ -528,7 +528,6 @@ class tFile:
@func @func
def assertBlk(t, blk, dataok, pinokByWLink=None): def assertBlk(t, blk, dataok, pinokByWLink=None):
#print('assertBlk #%d' % blk) #print('assertBlk #%d' % blk)
# XXX -> assertCtx('blk #%d' % blk) # XXX -> assertCtx('blk #%d' % blk)
def _(): def _():
assertCtx = 'blk #%d' % blk assertCtx = 'blk #%d' % blk
...@@ -613,8 +612,8 @@ class tFile: ...@@ -613,8 +612,8 @@ class tFile:
# XXX hack - wlinks are notified and emit events simultaneously - we # XXX hack - wlinks are notified and emit events simultaneously - we
# check only that events begin and end with read pre/post and that pins # check only that events begin and end with read pre/post and that pins
# are inside. Better do explicit check in tracetest style. # are inside. Better do explicit check in tracetest style.
assert ev[0] == 'read pre' assert ev[0] == 'read pre', ev
assert ev[-1] == 'read ' + dataok[0] assert ev[-1] == 'read ' + dataok[0], ev
ev = ev[1:-1] ev = ev[1:-1]
if not shouldPin: if not shouldPin:
assert ev == [] assert ev == []
...@@ -1015,14 +1014,20 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str) ...@@ -1015,14 +1014,20 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str)
for wlink, (zf, pinok) in pinokByWLink.items(): for wlink, (zf, pinok) in pinokByWLink.items():
def _(ctx, wlink): def _(ctx, wlink):
pinv = wlink._expectPin(ctx, zf, pinok) pinv = wlink._expectPin(ctx, zf, pinok)
ev.append('pin rx') # XXX + zf, pin details? if len(pinv) > 0:
tdelay() # increase probability to receive erroneous extra pins ev.append('pin rx') # XXX + zf, pin details?
if pinfunc is not None:
# increase probability to receive erroneous extra pins
tdelay()
if len(pinv) > 0:
if pinfunc is not None:
for p in pinv:
pinfunc(wlink, p.foid, p.blk, p.at)
ev.append('pin ack pre') # XXX +details?
for p in pinv: for p in pinv:
pinfunc(wlink, p.foid, p.blk, p.at) p.reply(b"ack")
ev.append('pin ack pre') # XXX +details?
for p in pinv:
p.reply(b"ack")
# check that we don't get extra pins before f completes # check that we don't get extra pins before f completes
try: try:
req = wlink.recvReq(ctx) req = wlink.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