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
e9438567
Commit
e9438567
authored
Jun 24, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b331a75d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+18
-8
No files found.
wcfs/wcfs_test.py
View file @
e9438567
...
@@ -1266,6 +1266,7 @@ def test_wcfs_basic():
...
@@ -1266,6 +1266,7 @@ def test_wcfs_basic():
# verify all blocks
# verify all blocks
f
.
assertData
([
''
,
''
,
'c3'
,
'd2'
,
''
,
'f3'
])
f
.
assertData
([
''
,
''
,
'c3'
,
'd2'
,
''
,
'f3'
])
f
.
assertCache
([
1
,
1
,
1
,
1
,
1
,
1
])
# verify that watch setup is robust to client errors/misbehaviour.
# verify that watch setup is robust to client errors/misbehaviour.
...
@@ -1338,27 +1339,36 @@ def test_wcfs_watch_robust():
...
@@ -1338,27 +1339,36 @@ def test_wcfs_watch_robust():
# verify that watch setup/update sends correct pins.
# verify that watch setup/update sends correct pins.
@
func
@
func
def
test_wcfs_watch_setup
():
def
test_wcfs_watch_setup
():
t
=
tDB
();
zf
=
t
.
zfile
t
=
tDB
();
zf
=
t
.
zfile
;
at0
=
t
.
at0
defer
(
t
.
close
)
defer
(
t
.
close
)
f
=
t
.
open
(
zf
)
f
=
t
.
open
(
zf
)
at1
=
t
.
commit
(
zf
,
{
2
:
'c1'
})
at1
=
t
.
commit
(
zf
,
{
2
:
'c1'
})
# XXX + hold -> zblk
at2
=
t
.
commit
(
zf
,
{
2
:
'c2'
,
3
:
'd2'
,
5
:
'f2'
})
at2
=
t
.
commit
(
zf
,
{
2
:
'c2'
,
3
:
'd2'
,
5
:
'f2'
})
at3
=
t
.
commit
(
zf
,
{
2
:
'c3'
,
5
:
'f3'
})
at3
=
t
.
commit
(
zf
,
{
2
:
'c3'
,
5
:
'f3'
})
f
.
assertData
([
''
,
''
,
'c3'
,
'd2'
,
''
,
'x'
])
f
.
assertData
([
''
,
''
,
'c3'
,
'd2'
,
''
,
'f3'
])
# access everything as of @at3
f
.
assertCache
([
1
,
1
,
1
,
1
,
1
,
1
])
# change again, but don't access f
at4
=
t
.
commit
(
zf
,
{
2
:
'c4'
,
5
:
'f4'
})
at5
=
t
.
commit
(
zf
,
{
3
:
'd5'
,
5
:
'f5'
})
f
.
assertData
([
''
,
''
,
'c4'
,
'd5'
,
''
,
'x'
])
f
.
assertCache
([
1
,
1
,
1
,
1
,
1
,
0
])
f
.
assertCache
([
1
,
1
,
1
,
1
,
1
,
0
])
# some watch setup/update requests with explicit pinok (also partly
# some watch setup/update requests with explicit pinok (also partly
# verifies how tWatchLink.watch computes automatic pinok)
# verifies how tWatchLink.watch computes automatic pinok)
wl
=
t
.
openwatch
()
wl
=
t
.
openwatch
()
# XXX check @at0 ?
# XXX check @at0 ?
wl
.
watch
(
zf
,
at1
,
{
2
:
at1
,
3
:
t
.
at0
})
# -> at1 (new watch) XXX at0 -> ø (blk3 was hole)
?
wl
.
watch
(
zf
,
at1
,
{
2
:
at1
,
3
:
at0
,
5
:
at0
})
# -> at1 (new watch) XXX at0 -> ø
?
wl
.
watch
(
zf
,
at2
,
{
2
:
at2
,
3
:
None
})
# at1 -> at2
wl
.
watch
(
zf
,
at2
,
{
2
:
at2
,
3
:
at2
,
5
:
at2
})
# at1 -> at2
wl
.
watch
(
zf
,
at3
,
{
2
:
None
})
# at2 -> at3 (current head)
wl
.
watch
(
zf
,
at3
,
{
2
:
at3
,
5
:
at3
})
# at2 -> at3
# XXX + .watch in presence !accessed & changed [blk]
wl
.
watch
(
zf
,
at4
,
{
2
:
None
,
5
:
at4
})
# at3 -> at4 f(5) pinned even it was not accessed >=4
# XXX move f4 commit here?
wl
.
watch
(
zf
,
at5
,
{
3
:
None
,
5
:
None
})
# at4 -> at5 (current head)
wl
.
close
()
wl
.
close
()
return
# XXX direct ->at2 ->at3 ->at4 ->at5
# all valid watch setup/update requests going at_i -> at_j -> ... with automatic pinok
# all valid watch setup/update requests going at_i -> at_j -> ... with automatic pinok
for
zf
in
t
.
zfiles
():
for
zf
in
t
.
zfiles
():
...
...
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