Commit 2e3e2c60 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent edaf43c4
......@@ -247,17 +247,19 @@ def test_zconn_at():
at0 = stor.lastTransaction()
# open connection, it must be viewing the database @at0
conn1 = db.open()
tm1 = TransactionManager()
conn1 = db.open(transaction_manager=tm1)
assert zconn_at(conn1) == at0
# open another simultaneous connection
conn2 = db.open()
tm2 = TransactionManager()
conn2 = db.open(transaction_manager=tm2)
assert zconn_at(conn2) == at0
# commit
root1 = conn1.root()
root1['z'] = 1
transaction.commit()
tm1.commit()
# after commit conn1 view is updated; conn2 view stays @at0
zsync(stor)
......@@ -270,7 +272,7 @@ def test_zconn_at():
with raises(POSException.ConnectionStateError):
zconn_at(conn1)
assert zconn_at(conn2) == at0
conn1_ = db.open()
conn1_ = db.open(transaction_manager=tm1)
assert conn1_ is conn1 # returned from DB pool
assert zconn_at(conn1) == at1
assert zconn_at(conn2) == at0
......@@ -280,11 +282,11 @@ def test_zconn_at():
#
# TODO zconn_at after empty commit (with fs1 currently gives future tid,
# but db is not updated and wcfs client resync to that future tid hangs)
conn1_ = db.open()
assert conn1_ is conn2 # from DB pool
conn1_ = db.open(transaction_manager=tm1)
assert conn1_ is conn1 # from DB pool
assert zconn_at(conn1) == at1
assert zconn_at(conn2) == at0
transaction.commit()
tm1.commit()
zsync(stor)
at1_ = stor.lastTransaction()
......@@ -294,7 +296,7 @@ def test_zconn_at():
# reopen conn2 -> view upated to @at1_
conn2.close()
conn2_ = db.open()
conn2_ = db.open(transaction_manager=tm1)
assert conn2_ is conn2 # from DB pool
assert zconn_at(conn1) == at1_
assert zconn_at(conn2) == at1_
......
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