Add a retry mechanism

This commit is contained in:
Raoul Snyman 2016-01-15 19:58:21 +02:00
parent d7b9e2cbe5
commit b11b88f4eb

View File

@ -57,8 +57,14 @@ class TestUtilsDBFunctions(TestCase):
self.session.close()
self.session = None
gc.collect()
time.sleep(1)
os.unlink(self.db_tmp_path)
retries = 0
while retries < 5:
try:
os.unlink(self.db_tmp_path)
break
except:
time.sleep(1)
retries += 1
shutil.rmtree(self.tmp_folder)
def delete_column_test(self):