Commit 3d781761 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 01d15ac4
......@@ -1121,29 +1121,29 @@ def test_wcfs():
f.assertData ([], mtime=at0)
# >>> (@at1) commit data -> we can see it on wcfs
t.change(zf, {2: '1cc'})
t.change(zf, {2: 'c1'})
at1 = t.commit()
f.assertCache([0,0,0]) # initially not cached
f.assertData (['','','1cc'], mtime=t.head)
f.assertData (['','','c1'], mtime=t.head)
# >>> (@at2) commit again -> we can see both latest and snapshotted states
t.change(zf, {2: '2c', 3: '2d'})
t.change(zf, {2: 'c2', 3: 'd2'})
at2 = t.commit()
# f @head
f.assertCache([1,1,0,0])
f.assertData (['','', '2c', '2d'], mtime=t.head)
f.assertData (['','', 'c2', 'd2'], mtime=t.head)
# f @at1
f1 = t.open(zf, at=at1)
f1.assertCache([0,0,1])
f1.assertData (['','','1cc']) # XXX + mtime=at1?
f1.assertData (['','','c1']) # XXX + mtime=at1?
# >>> (@at3) commit again without changing zf size XXX write about b cache inval
f2 = t.open(zf, at=at2)
t.change(zf, {2: '3c'}) # FIXME + 3b after δbtree works (hole -> zblk)
t.change(zf, {2: 'c3'}) # FIXME + 3b after δbtree works (hole -> zblk)
at3 = t.commit()
f.assertCache([1,1,0,1]) # FIXME b must be invalidated (see 3b ^^^)
......@@ -1156,15 +1156,15 @@ def test_wcfs():
# f @head
f.assertCache([1,1,0,1])
f.assertData (['','','3c','2d'], mtime=t.head)
f.assertData (['','','c3','d2'], mtime=t.head)
# f @at2
f2.assertCache([0,0,1,0])
f2.assertData (['','','2c','2d']) # XXX mtime=at2?
f2.assertData (['','','c2','d2']) # XXX mtime=at2?
# f @at1
f1.assertCache([1,1,1])
f1.assertData (['','','1cc']) # XXX + mtime=at1?
f1.assertData (['','','c1']) # XXX mtime=at1?
# >>> f close / open again -> cache must not be lost
......@@ -1277,7 +1277,7 @@ def test_wcfs():
assert w2.pinned == pinw2
f.assertCache([1,1,1,1])
t.change(zf, { 2: '4c', 5: '4f'}) # FIXME + 4a after δbtree works & update everything vvv
t.change(zf, { 2: 'c4', 5: 'f4'}) # FIXME + 4a after δbtree works & update everything vvv
at4 = t.commit()
f.assertCache([1,1,0,1,0,0])
......@@ -1287,10 +1287,10 @@ def test_wcfs():
f.assertBlk(1, '', {wl3: {}, wl3_: {}, wl2: {}})
w_assertPin( {}, {}, {2:at2})
f.assertBlk(2, '4c', {wl3: {2:at3}, wl3_: {2:at3}, wl2: {}})
f.assertBlk(2, 'c4', {wl3: {2:at3}, wl3_: {2:at3}, wl2: {}})
w_assertPin( {2:at3}, {2:at3}, {2:at2})
f.assertBlk(3, '2d', {wl3: {}, wl3_: {}, wl2: {}})
f.assertBlk(3, 'd2', {wl3: {}, wl3_: {}, wl2: {}})
w_assertPin( {2:at3}, {2:at3}, {2:at2})
# blk4 is hole @head - the same as at earlier db view - not pinned
......@@ -1298,7 +1298,7 @@ def test_wcfs():
f.assertBlk(4, '', {wl3: {}, wl3_: {}, wl2: {}})
w_assertPin( {2:at3}, {2:at3}, {2:at2})
f.assertBlk(5, '4f', {wl3: {5:at0}, wl3_: {5:at0}, wl2: {5:at0}}) # XXX at0->ø?
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})
# commit again:
......@@ -1306,7 +1306,7 @@ def test_wcfs():
# - 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'})
t.change(zf, {2: 'c5', 3: 'd5'})
at5 = t.commit()
f.assertCache([1,1,0,0,1,1])
......@@ -1325,16 +1325,16 @@ def test_wcfs():
f.assertBlk(1, '', {wl3: {}, wl3_: {}})
w_assertPin( {2:at3, 5:at0})
f.assertBlk(2, '5c', {wl3: {}, wl3_: {}}) # blk2 already pinned on wl3
f.assertBlk(2, 'c5', {wl3: {}, wl3_: {}}) # blk2 already pinned on wl3
w_assertPin( {2:at3, 5:at0})
f.assertBlk(3, '5d', {wl3: {3:at2}, wl3_: {}}) # wl3_ not notified
f.assertBlk(3, 'd5', {wl3: {3:at2}, wl3_: {}}) # wl3_ not notified
w_assertPin( {2:at3, 3:at2, 5:at0})
f.assertBlk(4, '', {wl3: {}, wl3_: {}})
w_assertPin( {2:at3, 3:at2, 5:at0})
f.assertBlk(5, '4f', {wl3: {}, wl3_: {}})
f.assertBlk(5, 'f4', {wl3: {}, wl3_: {}})
w_assertPin( {2:at3, 3:at2, 5:at0})
# XXX advance watch - receives new pins/unpins to @head
......
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