Commit b331a75d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4271fed4
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment