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
488ce5e1
Commit
488ce5e1
authored
Jun 06, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
47fbed49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+11
-5
No files found.
wcfs/wcfs_test.py
View file @
488ce5e1
...
...
@@ -719,7 +719,6 @@ def watch(twlink, zf, at): # XXX -> ?
pinv
.
append
(
'%d: %s'
%
(
blk
,
s
))
return
'{%s}'
%
', '
.
join
(
pinv
)
pin_prev
=
{}
if
at_prev
is
not
None
:
assert
at_prev
<=
at
,
'TODO %s -> %s'
%
(
t
.
hat
(
at_prev
),
t
.
hat
(
at
))
...
...
@@ -751,11 +750,19 @@ def watch(twlink, zf, at): # XXX -> ?
#print('-> %s' % pinstr(pin))
# {} blk -> at that have to be pinned
# {} blk -> at that have to be pinned
.
# XXX also check that head/file[blk] is in cache - else no need to pin
pinok
=
pin
print
(
'# pinok: %s'
%
pinstr
(
pinok
))
twlink
.
_watch
(
zf
,
at
,
pinok
,
"ok"
)
# _watch sends watch request for zf@at, expects initial pins specified by pinok, and finaly reply.
#
# pinok: {} blk -> at that have to be pinned.
@
func
(
tWatchLink
)
def
_watch
(
twlink
,
zf
,
at
,
pinok
,
reply
):
# send watch request and check that we receive pins for in-cache blocks
# changed > at. Use timeout to detect wcfs replying less pins than expected.
#
...
...
@@ -781,7 +788,7 @@ def watch(twlink, zf, at): # XXX -> ?
wg
.
go
(
_
)
def
_
(
ctx
):
assert
twlink
.
sendReq
(
ctx
,
b"watch %s @%s"
%
(
h
(
zf
.
_p_oid
),
h
(
at
)))
==
"ok"
assert
twlink
.
sendReq
(
ctx
,
b"watch %s @%s"
%
(
h
(
zf
.
_p_oid
),
h
(
at
)))
==
reply
# cancel _expectPin waiting upon receiving "ok" from wcfs
# -> error that missed pins were not received.
cancel
()
...
...
@@ -918,8 +925,7 @@ def test_wcfs():
# watch with @at < δtail.tail -> rejected
print
(
'
\
n
\
n
AAA
\
n
\
n
'
)
wl
=
t
.
openwatch
()
assert
wl
.
sendReq
(
timeout
(),
b"watch %s @%s"
%
(
h
(
zf
.
_p_oid
),
h
(
p64
(
u64
(
at0
)
-
1
))))
==
\
"XXX"
wl
.
_watch
(
zf
,
p64
(
u64
(
at0
)
-
1
),
{},
"errXXX"
)
wl
.
close
()
return
# XXX
...
...
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