Commit 21e6e206 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8a98d791
......@@ -1217,27 +1217,27 @@ def test_wcfs():
print('\n\n\n\nWATCH+COMMIT\n\n')
# watched + commit -> read -> receive pin messages; read is stuck until pins are acknowledged
wl1 = t.openwatch()
wl2 = t.openwatch()
wl1.watch(zf, at3); assert at3 == t.head
wl2.watch(zf, at2)
wl3 = t.openwatch(); wl3.watch(zf, at3); assert at3 == t.head
wl3_ = t.openwatch(); wl3_.watch(zf, at3)
wl2 = t.openwatch(); wl2.watch(zf, at2)
f.assertCache([1,1,1,1])
t.change(zf, { 2: '4c', 5: '4f'}) # FIXME + 4a after δbtree works
at4 = t.commit()
f.assertCache([1,1,0,1,0,0]) # FIXME a must be invalidated - see δbtree ^^^
f.assertBlk(0, '', {wl1: {}, wl2: {}}) # XXX + {0, at3} after δbtree works
f.assertBlk(1, '', {wl1: {}, wl2: {}})
f.assertBlk(2, '4c', {wl1: {2: at3}, wl2: {}})
f.assertBlk(3, '2d', {wl1: {}, wl2: {}})
f.assertBlk(0, '', {wl3: {}, wl3_: {}, wl2: {}}) # XXX + {0, at3} after δbtree
f.assertBlk(1, '', {wl3: {}, wl3_: {}, wl2: {}})
f.assertBlk(2, '4c', {wl3: {2: at3}, wl3_: {2: at3}, wl2: {}})
f.assertBlk(3, '2d', {wl3: {}, wl3_: {}, wl2: {}})
# blk4 is hole @head - the same as at earlier db view - not pinned
# XXX or do not allow hole past .size ?
f.assertBlk(4, '', {wl1: {}, wl2: {}})
f.assertBlk(5, '4f', {wl1: {5: at0}, wl2: {5: at0}}) # XXX at0 -> ø XXX also triggers access to #4 ?
f.assertBlk(4, '', {wl3: {}, wl3_: {}, wl2: {}})
f.assertBlk(5, '4f', {wl3: {5: at0}, wl3_: {5: at0}, wl2: {5: at0}}) # XXX at0 -> ø?
# commit again:
# - block is already pinned (#2) -> not notified
# - wlink closed (wl2) -> watch no longer notified this
# - watch stopped (wl3_) -> watch no longer notified
# - wlink closed (wl2) -> watch no longer notified
f.assertCache([1,1,1,1,1,1])
t.change(zf, {2: '5c', 3: '5d'})
at5 = t.commit()
......@@ -1245,19 +1245,19 @@ def test_wcfs():
t.dump_history()
#wl3_.watch(zf, "-") XXX enable
wl2.close() # wl2 should not be notified because it was closed
f.assertBlk(0, '', {wl1: {}}) # no change
f.assertBlk(1, '', {wl1: {}})
f.assertBlk(2, '5c', {wl1: {}}) # blk2 already pinned on wl1
f.assertBlk(3, '5d', {wl1: {3: at2}})
f.assertBlk(4, '', {wl1: {}})
f.assertBlk(5, '4f', {wl1: {}})
f.assertBlk(0, '', {wl3: {}, wl3_: {}}) # no change
f.assertBlk(1, '', {wl3: {}, wl3_: {}})
f.assertBlk(2, '5c', {wl3: {}, wl3_: {}}) # blk2 already pinned on wl3
f.assertBlk(3, '5d', {wl3: {3: at2}, wl3_: {}}) # wl3_ not notified
f.assertBlk(4, '', {wl3: {}, wl3_: {}})
f.assertBlk(5, '4f', {wl3: {}, wl3_: {}})
# XXX watch with at="-" -> watch no longer notified this
# XXX 2 opened watchs for 1 file at the same time
wl1.close()
wl3.close()
# XXX commit after current file size -> watch
......
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