Commit 932cf47e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 358cd09c
......@@ -177,8 +177,8 @@ class tDB:
transaction.commit()
head = last._p_serial
t.ncommit += 1
print('commit -> @%s\t# @at%d' % (h(head), t.ncommit))
t.ncommit += 1
t.head = head
t._headv.append(head)
return head
......@@ -528,9 +528,10 @@ def test_wcfs():
t.root['!file'] = nonfile = Persistent()
t.root['zfile'] = zf = ZBigFile(blksize)
tid1 = t.commit()
tid2 = t.commit()
assert tidtime(tid2) > tidtime(tid1)
at0 = t.commit()
t.ncommit = 0 # so that atX in the code correspond with debug output
at0_ = t.commit()
assert tidtime(at0_) > tidtime(at0)
t.wcsync()
# >>> lookup non-BigFile -> must be rejected
......@@ -538,13 +539,10 @@ def test_wcfs():
t.stat(nonfile)
assert exc.value.errno == EINVAL
# reset ncommit so that atX in the code correspond with debug output
t.ncommit = 0
# >>> file initially empty
f = t.open(zf)
f.assertCache([])
f.assertData ([], mtime=tid1)
f.assertData ([], mtime=at0)
# >>> (@at1) commit data -> we can see it on wcfs
t.change(zf, {2: b'alpha'})
......@@ -620,8 +618,8 @@ def test_wcfs():
@func
def _():
defer(done.close)
pinv = w.expectPin([(zf, 2, at1), (zf, 3, at2)])
#pinv = w.expectPin({zf: [(2, at1), (3, at2)]}) XXX <- this way better? (sugar)
pinv = w.expectPin([(zf, 2, at1), (zf, 3, at0)])
#pinv = w.expectPin({zf: [(2, at1), (3, at0)]}) XXX <- this way better? (sugar)
for p in pinv:
p.ack()
go(_)
......
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