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
a7dde4cb
Commit
a7dde4cb
authored
May 03, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f9c4ebde
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+23
-10
No files found.
wcfs/wcfs_test.py
View file @
a7dde4cb
...
...
@@ -671,15 +671,27 @@ def test_wcfs():
# checkSetupWatch verifies setting up new watch for zf@at.
def
checkSetupWatch
(
zf
,
at
):
print
(
'
check setup watch f<%s>
@%s'
%
(
h
(
zf
.
_p_oid
),
h
(
at
)))
print
(
'
C: check setup watch f%s
@%s'
%
(
h
(
zf
.
_p_oid
),
h
(
at
)))
# all changes to zf
vdf
=
[
_
.
byfile
[
zf
]
for
_
in
t
.
dFtail
if
zf
in
t
.
dFtail
.
byfile
]
# changes to zf after at
vdfpost
=
[
_
for
_
in
vdf
if
_
.
rev
>
at
]
# XXX ...
vdf
=
[
_
.
byfile
[
zf
]
for
_
in
t
.
dFtail
if
zf
in
_
.
byfile
]
# {} blk -> at that have to be pinned
# XXX also check that head/file[blk] is in cache - else no need to pin
pinok
=
{}
for
df
in
[
_
for
_
in
vdf
if
_
.
rev
>
at
]:
for
blk
in
df
.
ddata
:
if
blk
in
pinok
:
continue
# history of blk changes <= at
blkhistoryat
=
[
_
.
rev
for
_
in
vdf
if
blk
in
_
.
ddata
and
_
.
rev
<=
at
]
if
len
(
blkhistoryat
)
==
0
:
pinrev
=
0
# was hole XXX -> h64
else
:
pinrev
=
max
(
blkhistoryat
)
pinok
[
blk
]
=
pinrev
print
(
'# pinok: %s'
%
pinok
)
# open watch, send watch request and check that we receive pins for
# in-cache blocks changed > at.
...
...
@@ -687,7 +699,7 @@ def test_wcfs():
ctx
,
cancel
=
context
.
with_cancel
(
bg
)
wg
=
sync
.
WorkGroup
(
ctx
)
def
_
(
ctx
):
pinv
=
w
.
expectPin
(
ctx
,
zf
,
{})
# XXX expect=?
pinv
=
w
.
expectPin
(
ctx
,
zf
,
pinok
)
for
p
in
pinv
:
p
.
reply
(
b"ack"
)
wg
.
go
(
_
)
...
...
@@ -697,8 +709,9 @@ def test_wcfs():
cancel
()
wg
.
wait
()
for
i
in
range
(
len
(
t
.
dFtail
)):
1
/
0
for
dF
in
t
.
dFtail
:
for
zf
in
dF
.
byfile
:
checkSetupWatch
(
zf
,
dF
.
rev
)
return
...
...
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