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

.

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