Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
8687b6f6
Commit
8687b6f6
authored
Jun 07, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4adb2a06
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
40 deletions
+2
-40
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+2
-40
No files found.
wcfs/wcfs_test.py
View file @
8687b6f6
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment