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
6fa72a36
Commit
6fa72a36
authored
May 10, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6f4c288b
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 @
6fa72a36
...
...
@@ -633,6 +633,12 @@ def watch(w, zf, at): # XXX -> ?
at_from
=
'(%s ->) '
%
t
.
hat
(
at_prev
)
print
(
'
\
n
C: setup watch f<%s> %s%s'
%
(
h
(
zf
.
_p_oid
),
at_from
,
t
.
hat
(
at
)))
# pinstr returns human-readable representation for {}blk->rev
def
pinstr
(
pin
):
pinv
=
[
'%d: %s'
%
(
blk
,
t
.
hat
(
pin
[
blk
]))
for
blk
in
sorted
(
pin
.
keys
())]
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
))
...
...
@@ -640,7 +646,8 @@ def watch(w, zf, at): # XXX -> ?
pin
=
w
.
_pinAt
(
zf
,
at
)
print
(
'
\
n
%s
\
n
%s'
%
(
pin_prev
,
pin
))
if
at_prev
!=
at
and
at_prev
is
not
None
:
print
(
'
\
n
%s
\
n
%s'
%
(
pinstr
(
pin_prev
),
pinstr
(
pin
)))
for
blk
in
set
(
pin_prev
.
keys
()).
union
(
pin
.
keys
()):
# blk ∉ pin_prev, blk ∉ pin -> cannot happen
...
...
@@ -661,13 +668,12 @@ def watch(w, zf, at): # XXX -> ?
if
pin_prev
[
blk
]
==
pin
[
blk
]:
del
pin
[
blk
]
# would need to pin to what it is already pinned
print
(
'-> %s'
%
pin
)
print
(
'-> %s'
%
pin
str
(
pin
)
)
# {} blk -> at that have to be pinned
# XXX also check that head/file[blk] is in cache - else no need to pin
pinok
=
pin
pinokv
=
[
'%d: %s'
%
(
blk
,
t
.
hat
(
pinok
[
blk
]))
for
blk
in
sorted
(
pinok
.
keys
())]
print
(
'# pinok: {%s}'
%
', '
.
join
(
pinokv
))
print
(
'# pinok: %s'
%
pinstr
(
pinok
))
# send watch request and check that we receive pins for in-cache blocks
# changed > at.
...
...
@@ -816,12 +822,12 @@ def test_wcfs():
w
.
close
()
# watch going at_i -> at_j
print
(
'
\
n
--------'
)
for
dF_from
in
t
.
dFtail
:
for
dF_to
in
t
.
dFtail
:
if
not
(
dF_from
.
rev
<=
dF_to
.
rev
):
continue
# FIXME TODO test all directions
print
(
'
\
n
--------'
)
w
=
t
.
openwatch
()
w
.
watch
(
zf
,
dF_from
.
rev
)
w
.
watch
(
zf
,
dF_to
.
rev
)
...
...
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