diff options
Diffstat (limited to 'src/third_party/wiredtiger/test/suite/test_timestamp28.py')
-rw-r--r-- | src/third_party/wiredtiger/test/suite/test_timestamp28.py | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp28.py b/src/third_party/wiredtiger/test/suite/test_timestamp28.py index 74086a1b8bd..259499d7182 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp28.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp28.py @@ -31,54 +31,29 @@ import wiredtiger, wttest from wtdataset import SimpleDataSet -from wtscenario import make_scenarios # Timestamps: smoke test that commit is tested at both commit and set time. class test_timestamp28(wttest.WiredTigerTestCase): - timestamps = [ - ('stable', dict(timestamp='stable_timestamp')), - ('oldest', dict(timestamp='oldest_timestamp')), - ] - error_logs = { - 'stable_timestamp': '/must be after/', - 'oldest_timestamp': '/is less than/', - } - scenarios = make_scenarios(timestamps) - def test_timestamp28(self): - uri = 'table:timestamp28' ds = SimpleDataSet(self, uri, 50, key_format='i', value_format='S') ds.populate() c = self.session.open_cursor(uri) - self.conn.set_timestamp(self.timestamp + '=' + self.timestamp_str(30)) + self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(30)) self.session.begin_transaction() c[5] = 'xxx' - self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: self.session.commit_transaction( - 'commit_timestamp=' + self.timestamp_str(20)), self.error_logs[self.timestamp]) + 'commit_timestamp=' + self.timestamp_str(20)), '/must be after/') - self.conn.set_timestamp(self.timestamp + '=' + self.timestamp_str(40)) + self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(40)) self.session.begin_transaction() c[5] = 'xxx' self.session.timestamp_transaction('commit_timestamp=' + self.timestamp_str(50)) - self.conn.set_timestamp(self.timestamp + '=' + self.timestamp_str(60)) - self.assertRaisesWithMessage(wiredtiger.WiredTigerError, - lambda: self.session.commit_transaction(), self.error_logs[self.timestamp]) - - # Confirm the earliest commit time is tested. - self.session.begin_transaction() - c[5] = 'xxx' - self.session.timestamp_transaction('commit_timestamp=' + self.timestamp_str(70)) - c[6] = 'xxx' - self.session.timestamp_transaction('commit_timestamp=' + self.timestamp_str(71)) - c[7] = 'xxx' - self.conn.set_timestamp(self.timestamp + "=" + self.timestamp_str(75)) + self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(60)) self.assertRaisesWithMessage(wiredtiger.WiredTigerError, - lambda: self.session.commit_transaction( - 'commit_timestamp=' + self.timestamp_str(80)), self.error_logs[self.timestamp]) + lambda: self.session.commit_transaction(), '/must be after/') if __name__ == '__main__': wttest.run() |