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
82f13653
Commit
82f13653
authored
Jun 20, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
afef5ec0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+9
-9
No files found.
wcfs/wcfs_test.py
View file @
82f13653
...
...
@@ -127,9 +127,8 @@ def test_join_autostart():
# ---- infrastructure for data access tests ----
# XXX place=?
# many tests need to be run with some reasonable timeout to detect lack of wcfs
# response. with_tim
out and timeout provides synta
tic shortcuts to do so.
# response. with_tim
eout and timeout provide syntac
tic shortcuts to do so.
def
with_timeout
(
parent
=
context
.
background
()):
# -> ctx, cancel
return
context
.
with_timeout
(
parent
,
3
*
time
.
second
)
...
...
@@ -438,7 +437,7 @@ class tFile:
blkmmap
=
t
.
fmmap
[
blk
*
t
.
blksize
:(
blk
+
1
)
*
t
.
blksize
]
# NOTE the kernel does not start readahead from access to
# MADV_RANDOM vma, but for a MADV_{NORMAL/SEQUENTIAL} vma it starts
# readhead which can go _beyond_ vma that was used to decide RA
# read
a
head which can go _beyond_ vma that was used to decide RA
# start. For this reason - to prevent RA started at one block to
# overlap with the next block, we put MADV_RANDOM vma at the end of
# every block covering last 1/8 of it.
...
...
@@ -557,6 +556,7 @@ class tFile:
assert
cached
==
0
# even if @head[blk] is uncached, the block could be
# already pinned by setup watch
# XXX assert blkaccessed.rev > w.at => w.pinned
if
blk
not
in
w
.
pinned
:
pinok
=
{
blk
:
t
.
tdb
.
_blkRev
(
t
.
zf
,
blk
,
w
.
at
)}
shouldPin
=
True
...
...
@@ -578,7 +578,7 @@ class tFile:
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,
# head/watch can receive pin message. Be careful to handle cancel
l
ation,
# so that on error in another worker we don't get stuck and the
# error can be propagated to wait and reported.
have_read
=
chan
(
1
)
...
...
@@ -710,7 +710,7 @@ class tWatchLink:
t
.
_serveCancel
()
# XXX we can get stuck here if wcfs does not behave as we want.
# XXX in particular if there is a silly - e.g. syntax or type error in
# test code - we curently get stuck here.
# test code - we cur
r
ently get stuck here.
#
# XXX -> better pthread_kill(SIGINT) instead of relying on wcfs proper behaviour?
try
:
...
...
@@ -1048,7 +1048,7 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str)
# Use timeout to detect wcfs replying less pins than expected.
#
# XXX detect not sent pins via ack'ing previous pins as they come in (not
# waiting for all of them) and then seeing that we did not received expeced
# waiting for all of them) and then seeing that we did not received expec
t
ed
# pin when f completes?
ctx
,
cancel
=
with_timeout
()
wg
=
sync
.
WorkGroup
(
ctx
)
...
...
@@ -1122,7 +1122,7 @@ def _expectPin(twlink, ctx, zf, expect): # -> []tSrvReq
try
:
req
=
twlink
.
recvReq
(
ctx
)
except
Exception
as
e
:
raise
RuntimeError
(
"%s
\
n
not all pin m
i
ssages received - pending:
\
n
%s"
%
(
e
,
expected
))
raise
RuntimeError
(
"%s
\
n
not all pin m
e
ssages received - pending:
\
n
%s"
%
(
e
,
expected
))
assert
req
is
not
None
# channel not closed
assert
req
.
msg
in
expected
expected
.
remove
(
req
.
msg
)
...
...
@@ -1412,7 +1412,7 @@ def test_wcfs():
# XXX blk not initially covered by f.δtail (blk never accessed - f.δtail
# not updated on invalidation). then blk is accessed - what happens with
# watch that should be trigger
r
ing for this blk?
# watch that should be triggering for this blk?
# XXX similar to ^^^ but with two changes to blk not covered by f.δtail. To
# which @rev blk is pinned on watch? (δtail is missing both and if it will
...
...
@@ -1523,7 +1523,7 @@ def dump_history(t):
#
# if deferred function raises exception itself - it prints previous exception to stderr.
#
# XXX xdefer is workaround for Python2 not having exception cha
n
ining (PEP 3134)
# XXX xdefer is workaround for Python2 not having exception chaining (PEP 3134)
# without which, if e.g. tDB.close() raises exception, it prevents to see
# whether and which an assert in the test failed.
#
...
...
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