Commit 4dfdf05a authored by Julien Muchembled's avatar Julien Muchembled

tests: an expected failure was actually due to a misuse of undo API

Obviously, oids can't be automatically invalidated if the undo is done directly
at the storage level.

In commit 9cca0f8e, only 1 bug was found.
parent 920484d7
......@@ -23,6 +23,7 @@ from thread import get_ident
from zlib import compress
from persistent import Persistent, GHOST
from ZODB import DB, POSException
from ZODB.DB import TransactionalUndo
from neo.storage.transactions import TransactionManager, \
DelayedError, ConflictError
from neo.lib.connection import MTClientConnection
......@@ -169,22 +170,20 @@ class Test(NEOThreadedTest):
t.commit()
ob.value += 1
t.commit()
tid = ob._p_serial
storage = cluster.db.storage
undo = TransactionalUndo(cluster.db, (ob._p_serial,))
txn = transaction.Transaction()
storage.tpc_begin(txn)
undo.tpc_begin(txn)
if conflict_during_store:
with Patch(cluster.client, waitResponses=waitResponses) as p:
storage.undo(tid, txn)
undo.commit(txn)
else:
ob.value += 3
t.commit()
storage.undo(tid, txn)
storage.tpc_finish(txn)
value = ob.value
ob._p_invalidate() # BUG: this should not be required
undo.commit(txn)
undo.tpc_vote(txn)
undo.tpc_finish(txn)
t.begin()
self.assertEqual(ob.value, 3)
expectedFailure(self.assertNotEqual)(value, 4)
finally:
cluster.stop()
......
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