From 115b6276ac3dd7b3e8c6a42e9d0d80709791b7a2 Mon Sep 17 00:00:00 2001 From: Avishay Traeger Date: Mon, 24 Feb 2014 19:55:15 +0200 Subject: [PATCH] Fix race in test_delete_backup Unit test sporadically failed due to timing issue - the deletion timestamp on the backup was exactly the same as timeutils.utcnow(), causing the AssertGreater check to fail. Change to AssertGreaterEqual. Change-Id: Ia66d0d4bdae3242780a91f0d384cbd17caa8c197 Closes-bug: #1284227 --- cinder/tests/test_backup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cinder/tests/test_backup.py b/cinder/tests/test_backup.py index 310326bd0..8d615cc31 100644 --- a/cinder/tests/test_backup.py +++ b/cinder/tests/test_backup.py @@ -357,7 +357,7 @@ class BackupTestCase(test.TestCase): ctxt_read_deleted = context.get_admin_context('yes') backup = db.backup_get(ctxt_read_deleted, backup_id) self.assertEqual(backup.deleted, True) - self.assertGreater(timeutils.utcnow(), backup.deleted_at) + self.assertGreaterEqual(timeutils.utcnow(), backup.deleted_at) self.assertEqual(backup.status, 'deleted') def test_list_backup(self): -- 2.45.2