summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/suite/test_timestamp04.py
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2019-04-16 14:36:51 +1000
committerLuke Chen <luke.chen@mongodb.com>2019-04-16 14:45:56 +1000
commita654dcf592ea7ed65426a0de96b4079ff4fc6716 (patch)
treea5256edad1bb219e6af72fd7e7525f58e235a307 /src/third_party/wiredtiger/test/suite/test_timestamp04.py
parent19b622ebfb42a525f38e278c09f440eb47b12f1e (diff)
downloadmongo-a654dcf592ea7ed65426a0de96b4079ff4fc6716.tar.gz
Import wiredtiger: 9416282c42d40328dfb7ff0f28831f639f98d3cb from branch mongodb-4.2
ref: 1768d66613..9416282c42 for: 4.1.11 WT-4317 Read checksum error in test_wt4156_metadata_salvage WT-4579 Track the newest durable timestamp for each page WT-4585 Add WT_WITH_HOTBACKUP_LOCK macro WT-4598 Enable the assertion that the durable_timestamp is newer than or equals the commit timestamp. WT-4640 Remove round_to_oldest in favour of roundup_timestamps WT-4695 Python3: allow most tests to run with Python3 with small changes WT-4696 Python3: change dist scripts to run under Python3 WT-4698 Python3: fix modify related tests WT-4699 Python3: fix test_jsondump02.py WT-4700 Python3: run with same source as Python2 WT-4703 Extend test/checkpoint to do removes and online checking WT-4704 Add statistic tracking oldest active read timestamp WT-4705 column-store no longer needs to handle WT_COL page offsets of 0 WT-4707 Failure in verifying cells with copied values WT-4708 Coverity reported copy-paste error in WiredTiger error message WT-4711 Python formatting errors reported while running "s_all" WT-4714 Use the durable timestamp to determine if a page should stay dirty WT-4724 Syntax error in wtperf_ckpt.sh when running 'dash' as default shell
Diffstat (limited to 'src/third_party/wiredtiger/test/suite/test_timestamp04.py')
-rw-r--r--src/third_party/wiredtiger/test/suite/test_timestamp04.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp04.py b/src/third_party/wiredtiger/test/suite/test_timestamp04.py
index 9251bfab06e..cf692d43edd 100644
--- a/src/third_party/wiredtiger/test/suite/test_timestamp04.py
+++ b/src/third_party/wiredtiger/test/suite/test_timestamp04.py
@@ -70,12 +70,12 @@ class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess):
if missing == False:
actual = dict((k, v) for k, v in cur if v != 0)
if actual != expected:
- print "missing: ", sorted(set(expected.items()) - set(actual.items()))
- print "extras: ", sorted(set(actual.items()) - set(expected.items()))
+ print("missing: ", sorted(set(expected.items()) - set(actual.items())))
+ print("extras: ", sorted(set(actual.items()) - set(expected.items())))
self.assertTrue(actual == expected)
# Search for the expected items as well as iterating.
- for k, v in expected.iteritems():
+ for k, v in expected.items():
if missing == False:
self.assertEqual(cur[k], v, "for key " + str(k))
else:
@@ -104,7 +104,7 @@ class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess):
try:
self.conn = wiredtiger.wiredtiger_open(self.home, conn_params)
except wiredtiger.WiredTigerError as e:
- print "Failed conn at '%s' with config '%s'" % (dir, conn_params)
+ print("Failed conn at '%s' with config '%s'" % (dir, conn_params))
self.session = self.conn.open_session(None)
def test_rollback_to_stable(self):
@@ -131,7 +131,7 @@ class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess):
# Insert keys each with timestamp=key, in some order.
key_range = 10000
- keys = range(1, key_range + 1)
+ keys = list(range(1, key_range + 1))
# Set keys 1-key_range to value 1.
for k in keys:
@@ -159,7 +159,7 @@ class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess):
# Scenario: 2
# Roll back half timestamps.
- stable_ts = timestamp_str(key_range / 2)
+ stable_ts = timestamp_str(key_range // 2)
self.conn.set_timestamp('stable_timestamp=' + stable_ts)
self.conn.rollback_to_stable()
stat_cursor = self.session.open_cursor('statistics:', None, None)
@@ -182,9 +182,9 @@ class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess):
# Check that we see the inserted value (i.e. 1) for the keys in a
# timestamped table until the stable_timestamp only.
self.check(self.session, 'read_timestamp=' + latest_ts,
- self.table_ts_nolog, dict((k, 1) for k in keys[:(key_range / 2)]))
+ self.table_ts_nolog, dict((k, 1) for k in keys[:(key_range // 2)]))
self.check(self.session, 'read_timestamp=' + latest_ts,
- self.table_ts_nolog, dict((k, 1) for k in keys[(key_range / 2 + 1):]), missing=True)
+ self.table_ts_nolog, dict((k, 1) for k in keys[(key_range // 2 + 1):]), missing=True)
# For logged tables, the behavior of rollback_to_stable changes based on
# whether connection level logging is enabled or not.
@@ -198,9 +198,9 @@ class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess):
# Check that we see the insertions are rolled back in timestamped tables
# until the stable_timestamp.
self.check(self.session, 'read_timestamp=' + latest_ts,
- self.table_ts_log, dict((k, 1) for k in keys[:(key_range / 2)]))
+ self.table_ts_log, dict((k, 1) for k in keys[:(key_range // 2)]))
self.check(self.session, 'read_timestamp=' + latest_ts,
- self.table_ts_log, dict((k, 1) for k in keys[(key_range / 2 + 1):]), missing=True)
+ self.table_ts_log, dict((k, 1) for k in keys[(key_range // 2 + 1):]), missing=True)
# Bump the oldest timestamp, we're not going back.
self.conn.set_timestamp('oldest_timestamp=' + stable_ts)
@@ -229,7 +229,7 @@ class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess):
# Scenario: 4
# Advance the stable_timestamp by a quarter range and rollback.
# Three-fourths of the later timestamps will be rolled back.
- rolled_range = key_range + key_range / 4
+ rolled_range = key_range + key_range // 4
stable_ts = timestamp_str(rolled_range)
self.conn.set_timestamp('stable_timestamp=' + stable_ts)
self.conn.rollback_to_stable()
@@ -257,10 +257,10 @@ class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess):
# the updated value (i.e. 2) for the first quarter keys and old values
# (i.e. 1) for the second quarter keys.
self.check(self.session, 'read_timestamp=' + latest_ts,
- self.table_ts_nolog, dict((k, 2 if k <= key_range / 4 else 1)
- for k in keys[:(key_range / 2)]))
+ self.table_ts_nolog, dict((k, 2 if k <= key_range // 4 else 1)
+ for k in keys[:(key_range // 2)]))
self.check(self.session, 'read_timestamp=' + latest_ts,
- self.table_ts_nolog, dict((k, 1) for k in keys[(1 + key_range / 2):]), missing=True)
+ self.table_ts_nolog, dict((k, 1) for k in keys[(1 + key_range // 2):]), missing=True)
# For logged tables behavior changes for rollback_to_stable based on
# whether connection level logging is enabled or not.
@@ -275,10 +275,10 @@ class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess):
# the updated value (i.e. 2) for the first quarter keys and old values
# (i.e. 1) for the second quarter keys.
self.check(self.session, 'read_timestamp=' + latest_ts,
- self.table_ts_log, dict((k, (2 if k <= key_range / 4 else 1))
- for k in keys[:(key_range / 2)]))
+ self.table_ts_log, dict((k, (2 if k <= key_range // 4 else 1))
+ for k in keys[:(key_range // 2)]))
self.check(self.session, 'read_timestamp=' + latest_ts,
- self.table_ts_log, dict((k, 1) for k in keys[(1 + key_range / 2):]), missing=True)
+ self.table_ts_log, dict((k, 1) for k in keys[(1 + key_range // 2):]), missing=True)
if __name__ == '__main__':
wttest.run()