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
b331a75d
Commit
b331a75d
authored
Jun 24, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4271fed4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+10
-15
No files found.
wcfs/wcfs_test.py
View file @
b331a75d
...
...
@@ -1210,16 +1210,14 @@ def test_wcfs_basic():
f
.
assertData
([],
mtime
=
t
.
at0
)
# >>> (@at1) commit data -> we can see it on wcfs
t
.
change
(
zf
,
{
2
:
'c1'
})
at1
=
t
.
commit
()
at1
=
t
.
commit
(
zf
,
{
2
:
'c1'
})
f
.
assertCache
([
0
,
0
,
0
])
# initially not cached
f
.
assertData
([
''
,
''
,
'c1'
],
mtime
=
t
.
head
)
# >>> (@at2) commit again -> we can see both latest and snapshotted states
# NOTE blocks d(4) and f(5) will be accessed only in the end
t
.
change
(
zf
,
{
2
:
'c2'
,
3
:
'd2'
,
5
:
'f2'
})
at2
=
t
.
commit
()
at2
=
t
.
commit
(
zf
,
{
2
:
'c2'
,
3
:
'd2'
,
5
:
'f2'
})
# f @head
f
.
assertCache
([
1
,
1
,
0
,
0
,
0
,
0
])
...
...
@@ -1234,8 +1232,7 @@ def test_wcfs_basic():
# >>> (@at3) commit again without changing zf size
f2
=
t
.
open
(
zf
,
at
=
at2
)
t
.
change
(
zf
,
{
2
:
'c3'
,
5
:
'f3'
})
# FIXME + a3 after δbtree works (hole -> zblk)
at3
=
t
.
commit
()
at3
=
t
.
commit
(
zf
,
{
2
:
'c3'
,
5
:
'f3'
})
# FIXME + a3 after δbtree works (hole -> zblk)
f
.
assertCache
([
1
,
1
,
0
,
1
,
0
,
0
])
...
...
@@ -1277,8 +1274,8 @@ def test_wcfs_watch_robust():
t
=
tDB
();
zf
=
t
.
zfile
defer
(
t
.
close
)
t
.
change
(
zf
,
{
2
:
'c1'
});
at1
=
t
.
commit
(
)
t
.
change
(
zf
,
{
2
:
'c2'
});
at2
=
t
.
commit
(
)
at1
=
t
.
commit
(
zf
,
{
2
:
'c1'
}
)
at2
=
t
.
commit
(
zf
,
{
2
:
'c2'
}
)
# file not yet opened on wcfs
wl
=
t
.
openwatch
()
...
...
@@ -1311,7 +1308,7 @@ def test_wcfs_watch_robust():
# NOTE if wcfs.go does not fully cleanup this canceled watch and leaves it
# in half-working state, it will break on further commit, as pin to the
# watch won't be handled.
t
.
change
(
zf
,
{
2
:
'c3'
});
at3
=
t
.
commit
(
)
at3
=
t
.
commit
(
zf
,
{
2
:
'c3'
}
)
# invalid requests -> wcfs replies error
wl
=
t
.
openwatch
()
...
...
@@ -1346,8 +1343,8 @@ def test_wcfs_watch_setup():
f
=
t
.
open
(
zf
)
at1
=
t
.
commit
(
zf
,
{
2
:
'c1'
})
t
.
change
(
zf
,
{
2
:
'c2'
,
3
:
'd2'
,
5
:
'f2'
});
at2
=
t
.
commit
(
)
t
.
change
(
zf
,
{
2
:
'c3'
,
5
:
'f3'
});
at3
=
t
.
commit
(
)
at2
=
t
.
commit
(
zf
,
{
2
:
'c2'
,
3
:
'd2'
,
5
:
'f2'
}
)
at3
=
t
.
commit
(
zf
,
{
2
:
'c3'
,
5
:
'f3'
}
)
f
.
assertData
([
''
,
''
,
'c3'
,
'd2'
,
''
,
'x'
])
f
.
assertCache
([
1
,
1
,
1
,
1
,
1
,
0
])
...
...
@@ -1405,8 +1402,7 @@ def _test_wcfs_test_watch_vs_commit():
f
.
assertCache
([
1
,
1
,
1
,
1
,
0
,
0
])
# 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
()
at4
=
t
.
commit
(
zf
,
{
2
:
'c4'
,
5
:
'f4'
,
6
:
'g4'
})
# FIXME + b4 after δbtree works + update vvv
f
.
assertCache
([
1
,
1
,
0
,
1
,
0
,
0
,
0
])
f
.
assertBlk
(
0
,
''
,
{
wl3
:
{},
wl3_
:
{},
wl2
:
{}})
...
...
@@ -1437,8 +1433,7 @@ def _test_wcfs_test_watch_vs_commit():
# - wlink closed (wl2) -> watch no longer notified
# - 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
()
at5
=
t
.
commit
(
zf
,
{
2
:
'c5'
,
3
:
'd5'
,
5
:
'f5'
})
f
.
assertCache
([
1
,
1
,
0
,
0
,
1
,
0
,
1
])
wl3_
.
stop_watch
(
zf
)
# w3_ should not be notified
...
...
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