Commit a7b82ee1 authored by Shane Hathaway's avatar Shane Hathaway

More thorough version of the invalidation test

parent 33019f0c
...@@ -38,23 +38,23 @@ class MVCCTests: ...@@ -38,23 +38,23 @@ class MVCCTests:
# This will fail if the Connection doesn't poll for changes. # This will fail if the Connection doesn't poll for changes.
db = DB(self._storage) db = DB(self._storage)
try: try:
c1 = db.open() c1 = db.open(transaction.TransactionManager())
r1 = c1.root() r1 = c1.root()
r1['myobj'] = 'yes' r1['myobj'] = 'yes'
c2 = db.open() c2 = db.open(transaction.TransactionManager())
r2 = c2.root() r2 = c2.root()
self.assert_('myobj' not in r2) self.assert_('myobj' not in r2)
storage = c1._storage old_tid = c1._storage._polled_tid
t = transaction.Transaction() c1.transaction_manager.commit()
t.description = 'invalidation test' new_tid = c1._storage._polled_tid
storage.tpc_begin(t)
c1.commit(t) self.assertNotEqual(new_tid, old_tid)
storage.tpc_vote(t) self.assertEqual(c2._storage._polled_tid, old_tid)
storage.tpc_finish(t)
self.assert_('myobj' not in r2) self.assert_('myobj' not in r2)
c2.sync() c2.sync()
self.assertEqual(new_tid, c2._storage._polled_tid)
self.assert_('myobj' in r2) self.assert_('myobj' in r2)
self.assert_(r2['myobj'] == 'yes') self.assert_(r2['myobj'] == 'yes')
finally: finally:
......
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