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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
381ce6b2
Commit
381ce6b2
authored
Jun 07, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
5d7f9718
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
54 deletions
+2
-54
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+2
-54
No files found.
wcfs/wcfs_test.py
View file @
381ce6b2
...
...
@@ -882,12 +882,12 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str)
ev
.
append
(
'pin ack pre'
)
# XXX +details?
for
p
in
pinv
:
p
.
reply
(
b"ack"
)
# check that we don't get extra pins before
reply to "watch"
# check that we don't get extra pins before
f completes
try
:
req
=
wlink
.
recvReq
(
ctx
)
except
Exception
as
e
:
if
e
is
context
.
canceled
:
return
# cancel is expected after
seeing "ok"
return
# cancel is expected after
f completes
reraise
(
e
,
None
,
e
.
__traceback__
)
assert
False
,
"extra pin message received: %r"
%
req
.
msg
...
...
@@ -1098,58 +1098,6 @@ def test_wcfs():
ev
=
doCheckingPin
(
_
,
{
wl
:
(
zf
,
pinok
)})
"""
# XXX dup wrte tWatchLink._watch
def _(ctx):
pinv = wl._expectPin(ctx, zf, pinok)
ev.append('pin rx')
tdelay() # XXX doc
ev.append('pin ack pre')
for p in pinv:
p.reply("ack")
# check that we don't get extra pins before read wakeup
try:
req = wl.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')
# 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(blk_data)
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))
# 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 4'
]
# 4 - read @head # XXX depend on blk
assert
f
.
cached
()[
blk
]
>
0
...
...
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