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
95d96a58
Commit
95d96a58
authored
Jun 06, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
488ce5e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+13
-4
No files found.
wcfs/wcfs_test.py
View file @
95d96a58
...
...
@@ -194,7 +194,8 @@ class tDB:
# ZBigFile(s) scheduled for commit
t
.
_changed
=
{}
# ZBigFile -> {} blk -> data
# committed: head + δF history
# committed: (tail, head] + δF history
t
.
tail
=
t
.
root
.
_p_jar
.
db
().
storage
.
lastTransaction
()
t
.
head
=
None
t
.
_headv
=
[]
# XXX -> just use dFtail[·].rev ?
t
.
dFtail
=
[]
# of DF
...
...
@@ -760,8 +761,9 @@ def watch(twlink, zf, at): # XXX -> ?
# _watch sends watch request for zf@at, expects initial pins specified by pinok, and finaly reply.
#
# pinok: {} blk -> at that have to be pinned.
# if replyok ends with '…' only reply prefix until the dots is checked.
@
func
(
tWatchLink
)
def
_watch
(
twlink
,
zf
,
at
,
pinok
,
reply
):
def
_watch
(
twlink
,
zf
,
at
,
pinok
,
reply
ok
):
# 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.
...
...
@@ -788,7 +790,12 @@ def _watch(twlink, zf, at, pinok, reply):
wg
.
go
(
_
)
def
_
(
ctx
):
assert
twlink
.
sendReq
(
ctx
,
b"watch %s @%s"
%
(
h
(
zf
.
_p_oid
),
h
(
at
)))
==
reply
reply
=
twlink
.
sendReq
(
ctx
,
b"watch %s @%s"
%
(
h
(
zf
.
_p_oid
),
h
(
at
)))
if
replyok
.
endswith
(
'…'
):
rok
=
replyok
[:
-
len
(
'…'
)]
assert
reply
[:
len
(
rok
)]
==
rok
else
:
assert
reply
==
replyok
# cancel _expectPin waiting upon receiving "ok" from wcfs
# -> error that missed pins were not received.
cancel
()
...
...
@@ -925,7 +932,9 @@ def test_wcfs():
# watch with @at < δtail.tail -> rejected
print
(
'
\
n
\
n
AAA
\
n
\
n
'
)
wl
=
t
.
openwatch
()
wl
.
_watch
(
zf
,
p64
(
u64
(
at0
)
-
1
),
{},
"errXXX"
)
atpast
=
p64
(
u64
(
t
.
tail
)
-
1
)
wl
.
_watch
(
zf
,
atpast
,
{},
"error setup watch f<%s> @%s: too far away back from"
" head/at (@%s); …"
%
(
h
(
zf
.
_p_oid
),
h
(
atpast
),
h
(
t
.
head
)))
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