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
44e100be
Commit
44e100be
authored
Jun 23, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6206ed68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+20
-14
No files found.
wcfs/wcfs_test.py
View file @
44e100be
...
...
@@ -1206,12 +1206,12 @@ def test_wcfs():
f1
.
assertData
([
''
,
''
,
'c1'
])
# XXX + mtime=at1?
# >>> (@at3) commit again without changing zf size
XXX write about b cache inval
# >>> (@at3) commit again without changing zf size
f2
=
t
.
open
(
zf
,
at
=
at2
)
t
.
change
(
zf
,
{
2
:
'c3'
})
# FIXME + a3 after δbtree works (hole -> zblk)
at3
=
t
.
commit
()
f
.
assertCache
([
1
,
1
,
0
,
1
])
# FIXME a must be invalidated (see a3 ^^^)
f
.
assertCache
([
1
,
1
,
0
,
1
])
# f @head is opened again -> cache must not be lost
f_
=
t
.
open
(
zf
)
...
...
@@ -1263,7 +1263,7 @@ def test_wcfs():
wg
.
go
(
_
)
wg
.
wait
()
wl
.
close
()
# NOTE if wcfs.go does not fully cleanup this canceled watch and leave it
# NOTE if wcfs.go does not fully cleanup this canceled watch and leave
s
it
# in half-working state, it will break on further commit, as pin to the
# watch won't be handled.
# TODO -> add explicit check for ^^^ if/when moved to separate test.
...
...
@@ -1300,6 +1300,7 @@ def test_wcfs():
wl
.
watch
(
zf
,
at2
,
{
2
:
at2
,
3
:
None
})
# at1 -> at2
wl
.
watch
(
zf
,
at3
,
{
2
:
None
})
# at2 -> at3 (current head)
# XXX + .watch in presence !accessed & changed [blk]
# XXX move f4 commit here?
wl
.
close
()
# all valid watch setup/update requests going at_i -> at_j -> ... with automatic pinok
...
...
@@ -1320,7 +1321,7 @@ def test_wcfs():
# watched + commit -> read -> receive pin messages.
# read vs pin ordering is checked by assertBlk.
#
#
5(f
) is kept not accessed to check later how wcfs.go handles δFtail
#
f(5
) 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
();
w3
=
wl3
.
watch
(
zf
,
at3
);
assert
at3
==
t
.
head
assert
w3
.
at
==
at3
...
...
@@ -1341,6 +1342,7 @@ def test_wcfs():
assert
w2
.
pinned
==
pinw2
f
.
assertCache
([
1
,
1
,
1
,
1
])
# XXX move f4 commit ^^^ (where watch with explicit pinok is tested)
t
.
change
(
zf
,
{
2
:
'c4'
,
5
:
'f4'
,
6
:
'g4'
})
# FIXME + b4 after δbtree works + update vvv
at4
=
t
.
commit
()
f
.
assertCache
([
1
,
1
,
0
,
1
,
0
,
0
,
0
])
...
...
@@ -1361,7 +1363,7 @@ def test_wcfs():
f
.
assertBlk
(
4
,
''
,
{
wl3
:
{},
wl3_
:
{},
wl2
:
{}})
w_assertPin
(
{
2
:
at3
},
{
2
:
at3
},
{
2
:
at2
})
#
5(f
) is kept unaccessed (see ^^^)
#
f(5
) is kept unaccessed (see ^^^)
assert
f
.
cached
()[
5
]
==
0
# f.assertBlk(5, 'f4', {wl3: {5:at0}, wl3_: {5:at0}, wl2: {5:at0}}) # XXX at0->ø?
# w_assertPin( {2:at3, 5:at0}, {2:at3, 5:at0}, {2:at2, 5:at0})
...
...
@@ -1370,10 +1372,10 @@ def test_wcfs():
w_assertPin
(
{
2
:
at3
,
6
:
at0
},
{
2
:
at3
,
6
:
at0
},
{
2
:
at2
,
6
:
at0
})
# commit again:
# -
2(c
) is already pinned -> wl3 not notified
# -
c(2
) is already pinned -> wl3 not notified
# - watch stopped (wl3_) -> watch no longer notified
# - wlink closed (wl2) -> watch no longer notified
# -
5(f
) is still kept unaccessed (see ^^^)
# -
f(5
) is still kept unaccessed (see ^^^)
f
.
assertCache
([
1
,
1
,
1
,
1
,
1
,
0
,
1
])
t
.
change
(
zf
,
{
2
:
'c5'
,
3
:
'd5'
,
5
:
'f5'
})
at5
=
t
.
commit
()
...
...
@@ -1392,16 +1394,16 @@ def test_wcfs():
f
.
assertBlk
(
1
,
''
,
{
wl3
:
{},
wl3_
:
{}})
w_assertPin
(
{
2
:
at3
,
6
:
at0
})
f
.
assertBlk
(
2
,
'c5'
,
{
wl3
:
{},
wl3_
:
{}})
#
2(c
) already pinned on wl3
f
.
assertBlk
(
2
,
'c5'
,
{
wl3
:
{},
wl3_
:
{}})
#
c(2
) already pinned on wl3
w_assertPin
(
{
2
:
at3
,
6
:
at0
})
f
.
assertBlk
(
3
,
'd5'
,
{
wl3
:
{
3
:
at2
},
wl3_
:
{}})
#
3(d
) was not pinned on wl3; wl3_ not notified
f
.
assertBlk
(
3
,
'd5'
,
{
wl3
:
{
3
:
at2
},
wl3_
:
{}})
#
d(3
) was not pinned on wl3; wl3_ not notified
w_assertPin
(
{
2
:
at3
,
3
:
at2
,
6
:
at0
})
f
.
assertBlk
(
4
,
''
,
{
wl3
:
{},
wl3_
:
{}})
w_assertPin
(
{
2
:
at3
,
3
:
at2
,
6
:
at0
})
#
5(f
) is kept still unaccessed (see ^^^)
#
f(5
) is kept still unaccessed (see ^^^)
assert
f
.
cached
()[
5
]
==
0
# f.assertBlk(5, 'f4', {wl3: {}, wl3_: {}})
# w_assertPin( {2:at3, 3:at2, 5:at0})
...
...
@@ -1412,16 +1414,20 @@ def test_wcfs():
# advance watch - receives new pins/unpins to @head.
# this is also tested ^^^ in `at_i -> at_j -> ...` watch setup/adjust.
# NOTE
5(f
) is not affected because it was not pinned previously.
# NOTE
f(5
) is not affected because it was not pinned previously.
wl3
.
watch
(
zf
,
at4
,
{
2
:
at4
,
6
:
None
})
# at3 -> at4
w_assertPin
(
{
2
:
at4
,
3
:
at2
})
return
# access f(5) -> wl3 should be correctly pinned
assert
f
.
cached
()
==
[
1
,
1
,
1
,
1
,
1
,
0
,
1
]
# f(5) was not yet accessed
f
.
assertBlk
(
5
,
'f5'
,
{
wl3
:
{
5
:
at4
},
wl3_
:
{}})
w_assertPin
(
{
2
:
at4
,
3
:
at2
,
5
:
at4
})
# XXX access 5(f) -> wl3 should be correctly pinned <- !!!
return
# advance watch again
wl3
.
watch
(
zf
,
at5
,
{
2
:
None
,
3
:
None
})
# at4 -> at5
w_assertPin
(
{})
w_assertPin
(
{})
# XXX + 5
wl3
.
close
()
...
...
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