diff options
Diffstat (limited to 'test/suite/test_txn05.py')
-rw-r--r-- | test/suite/test_txn05.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/test/suite/test_txn05.py b/test/suite/test_txn05.py index 7aaff221ba4..6a5be0a5df4 100644 --- a/test/suite/test_txn05.py +++ b/test/suite/test_txn05.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Public Domain 2014-2016 MongoDB, Inc. +# Public Domain 2014-2017 MongoDB, Inc. # Public Domain 2008-2014 WiredTiger, Inc. # # This is free and unencumbered software released into the public domain. @@ -101,7 +101,10 @@ class test_txn05(wttest.WiredTigerTestCase, suite_subprocess): self.check(self.session2, "isolation=read-uncommitted", current) # Opening a clone of the database home directory should run - # recovery and see the committed results. + # recovery and see the committed results. Flush the log because + # the backup may not get all the log records if we are running + # without a sync option. Use sync=off to force a write to the OS. + self.session.log_flush('sync=off') self.backup(self.backup_dir) backup_conn_params = 'log=(enabled,file_max=%s)' % self.logmax backup_conn = self.wiredtiger_open(self.backup_dir, backup_conn_params) @@ -134,12 +137,12 @@ class test_txn05(wttest.WiredTigerTestCase, suite_subprocess): 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) + if count == 0: + first_logs = \ + fnmatch.filter(os.listdir(self.backup_dir), "*Log*") backup_conn.close() count += 1 # @@ -149,6 +152,11 @@ class test_txn05(wttest.WiredTigerTestCase, suite_subprocess): # cur_logs = fnmatch.filter(os.listdir(self.backup_dir), "*Log*") for o in orig_logs: + # Creating the backup was effectively an unclean shutdown so + # even after sleeping, we should never archive log files + # because a checkpoint has not run. Later opens and runs of + # recovery will detect a clean shutdown and allow archiving. + self.assertEqual(True, o in first_logs) if self.archive == 'true': self.assertEqual(False, o in cur_logs) else: |