Commit e8aeb5d2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent daa44019
...@@ -1211,6 +1211,7 @@ def test_wcfs(): ...@@ -1211,6 +1211,7 @@ def test_wcfs():
wl.close() wl.close()
""" """
# XXX move before setup watch?
print('\n\n\n\nWATCH+COMMIT\n\n\n\n') print('\n\n\n\nWATCH+COMMIT\n\n\n\n')
# watched + commit -> read -> receive pin messages; read is stuck until pins are acknowledged # watched + commit -> read -> receive pin messages; read is stuck until pins are acknowledged
...@@ -1221,6 +1222,10 @@ def test_wcfs(): ...@@ -1221,6 +1222,10 @@ def test_wcfs():
at4 = t.commit() at4 = t.commit()
f.assertCache([1,1,0,1,0,0]) # FIXME a must be invalidated - see δbtree ^^^ f.assertCache([1,1,0,1,0,0]) # FIXME a must be invalidated - see δbtree ^^^
t.dump_history()
return
f.assertBlk(0, '', {wl: {}}) # XXX 0, {0, at3} after δbtree works f.assertBlk(0, '', {wl: {}}) # XXX 0, {0, at3} after δbtree works
f.assertBlk(1, '', {wl: {}}) f.assertBlk(1, '', {wl: {}})
f.assertBlk(2, '4c', {wl: {2: at3}}) f.assertBlk(2, '4c', {wl: {2: at3}})
...@@ -1230,12 +1235,11 @@ def test_wcfs(): ...@@ -1230,12 +1235,11 @@ def test_wcfs():
f.assertBlk(5, '4f', {wl: {5: at0}}) # XXX at0 -> ø XXX also triggers access to #4 ? f.assertBlk(5, '4f', {wl: {5: at0}}) # XXX at0 -> ø XXX also triggers access to #4 ?
# XXX watch "-" -> watch no longer notified # XXX wlink close -> watch no longer notified
# XXX close -> watch no longer notified
# XXX watch with at="-" -> stop watching # XXX watch with at="-" -> watch no longer notified
# XXX watch for 2 files via single watch open
# XXX 2 (or more) opened watch for 1 file at the same time # XXX 2 (or more) opened watch for 1 file at the same time
# XXX watch for 2 files via single watch open
wl.close() wl.close()
...@@ -1310,3 +1314,26 @@ def test_tidtime_notrough(): ...@@ -1310,3 +1314,26 @@ def test_tidtime_notrough():
for i in range(10): for i in range(10):
at = t.commit() at = t.commit()
assert tidtime(at) > tidtime(atprev) assert tidtime(at) > tidtime(atprev)
# dump_history prints change history in tabular form.
# the output is useful to get overview of how file(s) are changed in tests.
@func(tDB)
def dump_history(t):
print('>>> Change history by file:\n')
for zf in t.zfiles():
print('f<%s>:' % h(zf._p_oid))
for dF in t.dFtail:
df = dF.byfile.get(zf)
emitv = []
if df is not None:
dblk = set(df.ddata.keys())
for blk in range(max(dblk)+1):
if blk in dblk:
emitv.append('%d' % blk)
else:
emitv.append(' ')
print('\t%s\t%s' % (t.hat(dF.rev), ' '.join(emitv)))
print()
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