summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/suite/test_txn05.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/test/suite/test_txn05.py')
-rw-r--r--src/third_party/wiredtiger/test/suite/test_txn05.py28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/third_party/wiredtiger/test/suite/test_txn05.py b/src/third_party/wiredtiger/test/suite/test_txn05.py
index 9e84fe7d3fe..7aaff221ba4 100644
--- a/src/third_party/wiredtiger/test/suite/test_txn05.py
+++ b/src/third_party/wiredtiger/test/suite/test_txn05.py
@@ -64,23 +64,15 @@ class test_txn05(wttest.WiredTigerTestCase, suite_subprocess):
txn1s = [('t1c', dict(txn1='commit')), ('t1r', dict(txn1='rollback'))]
scenarios = make_scenarios(types, op1s, txn1s)
- # Overrides WiredTigerTestCase
- def setUpConnectionOpen(self, dir):
- self.home = dir
+
+ def conn_config(self):
# Cycle through the different transaction_sync values in a
# deterministic manner.
- self.txn_sync = self.sync_list[
+ txn_sync = self.sync_list[
self.scenario_number % len(self.sync_list)]
- self.backup_dir = os.path.join(self.home, "WT_BACKUP")
- conn_params = \
- 'log=(archive=false,enabled,file_max=%s),' % self.logmax + \
- 'create,error_prefix="%s: ",' % self.shortid() + \
- 'transaction_sync="%s",' % self.txn_sync
- # print "Creating conn at '%s' with config '%s'" % (dir, conn_params)
- conn = self.wiredtiger_open(dir, conn_params)
- self.pr(`conn`)
- self.session2 = conn.open_session()
- return conn
+ # Set archive false on the home directory.
+ return 'log=(archive=false,enabled,file_max=%s),' % self.logmax + \
+ 'transaction_sync="%s",' % txn_sync
# Check that a cursor (optionally started in a new transaction), sees the
# expected values.
@@ -139,8 +131,12 @@ class test_txn05(wttest.WiredTigerTestCase, suite_subprocess):
backup_conn = self.wiredtiger_open(self.backup_dir,
backup_conn_params)
try:
- self.check(backup_conn.open_session(), None, committed)
+ session = backup_conn.open_session()
finally:
+ self.check(session, None, committed)
+ # Force a checkpoint because we don't record the recovery
+ # checkpoint as available for archiving.
+ session.checkpoint("force")
# Sleep long enough so that the archive thread is guaranteed
# to run before we close the connection.
time.sleep(1.0)
@@ -163,6 +159,8 @@ class test_txn05(wttest.WiredTigerTestCase, suite_subprocess):
self.runWt(['-h', self.backup_dir, 'printlog'], outfilename='printlog.out')
def test_ops(self):
+ self.backup_dir = os.path.join(self.home, "WT_BACKUP")
+ self.session2 = self.conn.open_session()
# print "Creating %s with config '%s'" % (self.uri, self.create_params)
self.session.create(self.uri, self.create_params)
# Set up the table with entries for 1-5.