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
d1650e46
Commit
d1650e46
authored
Jun 23, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3e488c7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+16
-11
No files found.
wcfs/wcfs_test.py
View file @
d1650e46
...
...
@@ -857,7 +857,7 @@ class tSrvReq:
# The automatic computation of pinok is verified against explicitly provided
# pinok when it is present.
@
func
(
tWatchLink
)
def
watch
(
twlink
,
zf
,
at
,
pinok
=
None
):
# XXX -> tWatch ?
def
watch
(
twlink
,
zf
,
at
,
pinok
=
None
):
# -> tWatch
t
=
twlink
.
tdb
w
=
twlink
.
_watching
.
get
(
zf
)
if
w
is
None
:
...
...
@@ -929,6 +929,7 @@ def watch(twlink, zf, at, pinok=None): # XXX -> tWatch ?
w
.
at
=
at
assert
w
.
pinned
==
t
.
_needPinAt
(
zf
,
at
)
# XXX & headOfBlkAccess
return
w
# stop_watch instructs wlink to stop watching the file.
...
...
@@ -1099,6 +1100,7 @@ def _blkRevAt(t, zf, blk, at): # -> rev
_
,
rev
=
t
.
_blkDataAt
(
zf
,
blk
,
at
)
return
rev
# XXX kill
# XXX vvv -> not what we need, think again
# _blkHeadAccessed returns whether block state corresponding to zf[blk] at
# current head was accessed.
...
...
@@ -1115,6 +1117,7 @@ def _blkHeadAccessed(t, zf, blk):
zfAccessed.get(blk) vs t._blkRevAt(zf, blk, t.head)
"""
# XXX -> _pinDeltaAt ?
# _needPinAt returns which blocks needs to be pinned for zf@at compared to zf@head
# according to wcfs invalidation protocol.
#
...
...
@@ -1312,10 +1315,18 @@ def test_wcfs():
print
(
'
\
n
--------'
)
print
(
' -> '
.
join
([
t
.
hat
(
_
)
for
_
in
revv
]))
wl
=
t
.
openwatch
()
wl
.
watch
(
zf
,
revv
[
0
])
w
=
w
l
.
watch
(
zf
,
revv
[
0
])
wl
.
watch
(
zf
,
revv
[
0
])
# verify at_i -> at_i
for
at
in
revv
[
1
:]:
wl
.
watch
(
zf
,
at
)
# at_i -> at_j -> at_k must be the same as ø -> at_k
wl_
=
t
.
openwatch
()
w_
=
wl_
.
watch
(
zf
,
at
)
assert
w
.
at
==
w_
.
at
assert
w
.
pinned
==
w_
.
pinned
wl_
.
close
()
wl
.
close
()
# """
...
...
@@ -1326,21 +1337,15 @@ def test_wcfs():
#
# 5(f) is kept not accessed to check later how wcfs.go handles δFtail
# rebuild after it sees not yet accessed ZBlk that has change history.
wl3
=
t
.
openwatch
();
wl3
.
watch
(
zf
,
at3
);
assert
at3
==
t
.
head
assert
set
(
wl3
.
_watching
.
keys
())
==
{
zf
}
w3
=
wl3
.
_watching
[
zf
]
wl3
=
t
.
openwatch
();
w3
=
wl3
.
watch
(
zf
,
at3
);
assert
at3
==
t
.
head
assert
w3
.
at
==
at3
assert
w3
.
pinned
==
{}
wl3_
=
t
.
openwatch
();
wl3_
.
watch
(
zf
,
at3
)
assert
set
(
wl3_
.
_watching
.
keys
())
==
{
zf
}
w3_
=
wl3_
.
_watching
[
zf
]
wl3_
=
t
.
openwatch
();
w3_
=
wl3_
.
watch
(
zf
,
at3
)
assert
w3_
.
at
==
at3
assert
w3_
.
pinned
==
{}
wl2
=
t
.
openwatch
();
wl2
.
watch
(
zf
,
at2
)
assert
set
(
wl2
.
_watching
.
keys
())
==
{
zf
}
w2
=
wl2
.
_watching
[
zf
]
wl2
=
t
.
openwatch
();
w2
=
wl2
.
watch
(
zf
,
at2
)
assert
w2
.
at
==
at2
assert
w2
.
pinned
==
{
2
:
at2
}
...
...
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