Commit 8687b6f6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4adb2a06
......@@ -499,6 +499,7 @@ class tFile:
assert blk < t._sizeinblk()
cached = t.cached()[blk]
assert cached in (0, 1) # XXX temp - breaks becuase of kernel readahead
shouldPin = False # whether at least one wlink should receive a pin
# watches must be notified if access goes to @head/file; not if to @rev/file. XXX text
......@@ -1150,48 +1151,9 @@ def test_wcfs():
f.assertCache([1,1,0,1,0,0]) # FIXME a must be invalidated - see δbtree ^^^
f.assertBlk(2, '4c', {wl: {2: at3}})
# XXX 5, {5: ø}
f.assertBlk(5, '4f', {wl: {5: at0}}) # XXX at0 -> ø
# XXX 0, {0, at3} after δbtree works
"""
blk = 2
pinok = {2: at3} # XXX at3 -> at <= wl.at for zf
blkview = f.blk(blk)
assert f.cached()[blk] == 0
def _(ctx, ev):
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(blkview)
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))
ev = doCheckingPin(_, {wl: (zf, pinok)})
assert ev == ['read pre', 'pin rx', 'pin ack pre', 'read 4'] # 4 - read @head # XXX depend on blk
assert f.cached()[blk] > 0
f.assertBlk(blk, '4c')
assert f.cached()[blk] == 1
"""
wl.close()
......
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