diff options
Diffstat (limited to 'src/third_party/wiredtiger/test/suite/test_prepare01.py')
-rw-r--r-- | src/third_party/wiredtiger/test/suite/test_prepare01.py | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/src/third_party/wiredtiger/test/suite/test_prepare01.py b/src/third_party/wiredtiger/test/suite/test_prepare01.py index 596ceb6fdf8..94e9d95dc0e 100644 --- a/src/third_party/wiredtiger/test/suite/test_prepare01.py +++ b/src/third_party/wiredtiger/test/suite/test_prepare01.py @@ -32,6 +32,8 @@ from wtscenario import make_scenarios # test_prepare01.py # Transactions: basic functionality with prepare class test_prepare01(wttest.WiredTigerTestCase): + session_config = 'isolation=snapshot' + nentries = 1000 scenarios = make_scenarios([ ('col-f', dict(uri='file:text_txn01',key_format='r',value_format='S')), @@ -141,49 +143,5 @@ class test_prepare01(wttest.WiredTigerTestCase): self.session.commit_transaction() self.check(cursor, self.nentries, self.nentries) -# Test that read-committed is the default isolation level. -class test_read_committed_default(wttest.WiredTigerTestCase): - uri = 'table:test_prepare' - - # Return the number of records visible to the cursor. - def cursor_count(self, cursor): - count = 0 - for r in cursor: - count += 1 - return count - - def test_read_committed_default(self): - self.session.create(self.uri, 'key_format=S,value_format=S') - cursor = self.session.open_cursor(self.uri, None) - self.session.begin_transaction() - cursor['key: aaa'] = 'value: aaa' - - self.session.prepare_transaction("prepare_timestamp=2a") - self.session.timestamp_transaction("commit_timestamp=3a") - self.session.timestamp_transaction("durable_timestamp=3a") - self.session.commit_transaction() - self.session.begin_transaction() - cursor['key: bbb'] = 'value: bbb' - - s = self.conn.open_session() - cursor = s.open_cursor(self.uri, None) - s.begin_transaction("isolation=read-committed") - self.assertEqual(self.cursor_count(cursor), 1) - - s.prepare_transaction("prepare_timestamp=4a") - # commit timestamp can be same as prepare timestamp - s.timestamp_transaction("commit_timestamp=4a") - s.timestamp_transaction("durable_timestamp=4a") - s.commit_transaction() - s.begin_transaction() - self.assertEqual(self.cursor_count(cursor), 1) - s.prepare_transaction("prepare_timestamp=7a") - - # commit timestamp can be greater than prepare timestamp - s.timestamp_transaction("commit_timestamp=8a") - s.timestamp_transaction("durable_timestamp=8a") - s.commit_transaction() - s.close() - if __name__ == '__main__': wttest.run() |