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
736447eb
Commit
736447eb
authored
Jun 07, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d245e5ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
16 deletions
+45
-16
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+45
-16
No files found.
wcfs/wcfs_test.py
View file @
736447eb
...
...
@@ -805,7 +805,7 @@ def _watch(twlink, zf, at, pinok, replyok):
assert
reply
[:
len
(
rok
)]
==
rok
else
:
assert
reply
==
replyok
# cancel _expectPin waiting upon receiving
"ok"
from wcfs
# cancel _expectPin waiting upon receiving
reply
from wcfs
# -> error that missed pins were not received.
cancel
()
wg
.
go
(
_
)
...
...
@@ -966,25 +966,54 @@ def test_wcfs():
f
.
assertCache
([
1
,
1
,
1
,
1
])
t
.
change
(
zf
,
{
2
:
'4c'
,
5
:
'4f'
})
# FIXME + 4a after δbtree works
at4
=
t
.
commit
()
f
.
assertCache
([
1
,
1
,
0
,
1
,
0
,
0
])
# FIXME a must be invalidated - see ^^^
f
.
assertCache
([
1
,
1
,
0
,
1
,
0
,
0
])
# FIXME a must be invalidated - see δbtree ^^^
ctx
,
cancel
=
with_timeout
()
wg
=
sync
.
WorkGroup
(
ctx
)
blk
=
2
blk_data
=
f
.
blk
(
blk
)
assert
f
.
cached
()[
blk
]
==
0
# XXX dup wrte tWatchLink._watch
ev
=
[]
def
_
(
ctx
):
pinv
=
wl
.
_expectPin
(
ctx
,
zf
,
pinok
)
ev
.
append
(
'pin rx'
)
tdelay
()
# XXX + ev.sleep ?
ev
.
append
(
'pin ack'
)
pin
.
ack
()
blk
=
f
.
blk
(
2
)
assert
f
.
cached
()[
2
]
==
0
ev
.
append
(
'read pre'
)
blk
[
0
]
# read access -> XXX without GIL
ev
.
append
(
'read post'
)
assert
f
.
cached
()[
2
]
>
0
f
.
assertBlk
(
2
,
'4c'
)
assert
ev
==
[
'read pre'
,
'pin rx'
,
'pin ack'
,
'read post'
]
assert
f
.
cached
()[
2
]
==
1
tdelay
()
# XXX doc
ev
.
append
(
'pin ack pre'
)
for
p
in
pinv
:
pin
.
reply
(
"ack"
)
# check that we don't get extra pins before read wakeup
try
:
req
=
twlink
.
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'
)
blk_data
[
0
]
# read access -> XXX without GIL
ev
.
append
(
'read'
)
# 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'
]
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