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
14b40012
Commit
14b40012
authored
Jun 07, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
91592050
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+15
-9
No files found.
wcfs/wcfs_test.py
View file @
14b40012
...
...
@@ -498,14 +498,15 @@ class tFile:
dataok
+=
b'
\
0
'
*
(
t
.
blksize
-
len
(
dataok
))
# tailing zeros
assert
blk
<
t
.
_sizeinblk
()
cached
=
f
.
cached
()[
blk
]
cached
=
t
.
cached
()[
blk
]
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
wpin
=
{}
# tWatchLink -> (zf, pinok)
for
wlink
in
t
.
tdb
.
_wlinks
:
pinok
=
{}
if
t
.
at
is
None
:
# @head/...
wat
=
wlink
.
_watching
.
get
(
zf
)
wat
=
wlink
.
_watching
.
get
(
t
.
zf
)
if
wat
is
not
None
and
wat
<
blkrev
:
if
cached
==
1
:
# XXX assert blk already pinned on that watch
...
...
@@ -513,17 +514,18 @@ class tFile:
else
:
# XXX and watch not already pinned on the watch
pinok
=
{
blk
:
t
.
tdb
.
_blkRev
(
t
.
zf
,
blk
,
wat
)}
shouldPin
=
True
wpin
[
wlink
]
=
(
t
.
zf
,
pinok
)
if
pinokByWLink
is
not
None
:
assert
wpin
==
pinokByWLink
,
"computed vs explicit pinokByWLink"
pinokByWLink
=
wpin
blkview
=
f
.
blk
(
blk
)
assert
f
.
cached
()[
blk
]
==
cached
blkview
=
t
.
blk
(
blk
)
assert
t
.
cached
()[
blk
]
==
cached
def
_
(
ctx
,
ev
):
assert
f
.
cached
()[
blk
]
==
cached
assert
t
.
cached
()[
blk
]
==
cached
ev
.
append
(
'read pre'
)
# access data with released GIL so that the thread that reads data from
...
...
@@ -552,9 +554,13 @@ class tFile:
assert
ev
[
0
]
==
'read pre'
assert
ev
[
-
1
]
==
'read '
+
dataok
[
0
]
ev
=
ev
[
1
:
-
1
]
# XXX ev == 'pin rx', 'pin ack pre' ....
if
not
shouldPin
:
assert
ev
==
[]
else
:
assert
'pin rx'
in
ev
assert
'pin ack pre'
in
ev
assert
f
.
cached
()[
blk
]
>
0
assert
t
.
cached
()[
blk
]
>
0
# XXX assert individually for every block's page? (easier debugging?)
assert
blkview
==
dataok
,
(
"#blk: %d"
%
blk
)
...
...
@@ -1143,7 +1149,7 @@ def test_wcfs():
# XXX 5, {5: ø}
# XXX 0, {0, at3} after δbtree works
"""
"""
blk = 2
pinok = {2: at3} # XXX at3 -> at <= wl.at for zf
...
...
@@ -1180,7 +1186,7 @@ def test_wcfs():
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