diff --git a/test/suite/test_backup13.py b/test/suite/test_backup13.py index 4e53ff02e..4c4033bb6 100644 --- a/test/suite/test_backup13.py +++ b/test/suite/test_backup13.py @@ -33,6 +33,8 @@ from wtbackup import backup_base from wtdataset import simple_key from wtscenario import make_scenarios +import asyncio + # test_backup13.py # Test cursor backup with a block-based incremental cursor and force_stop. class test_backup13(backup_base): @@ -55,7 +57,7 @@ class test_backup13(backup_base): nops = 1000 - def simulate_crash_restart(self, olddir, newdir): + async def simulate_crash_restart(self, olddir, newdir): ''' Simulate a crash from olddir and restart in newdir. ''' # with the connection still open, copy files to new directory. shutil.rmtree(newdir, ignore_errors=True) @@ -67,6 +69,7 @@ class test_backup13(backup_base): "WiredTiger.lock" not in fullname and \ "Tmplog" not in fullname and \ "Preplog" not in fullname: + await asyncio.sleep(0.05) shutil.copy(fullname, newdir) # close the original connection and open to new directory. self.close_conn() @@ -129,7 +132,7 @@ class test_backup13(backup_base): lambda: self.session.open_cursor('backup:', None, config)) # Make sure after a crash we cannot access old backup info. - self.simulate_crash_restart(".", "RESTART") + asyncio.run(self.simulate_crash_restart(".", "RESTART")) self.assertRaises(wiredtiger.WiredTigerError, lambda: self.session.open_cursor('backup:', None, config))