]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix race in test_delete_backup
authorAvishay Traeger <avishay@il.ibm.com>
Mon, 24 Feb 2014 17:55:15 +0000 (19:55 +0200)
committerAvishay Traeger <avishay@il.ibm.com>
Mon, 24 Feb 2014 17:55:15 +0000 (19:55 +0200)
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

index 310326bd0af32cc0ae459e84575072283511ee6c..8d615cc31927b26c15c2b089ecc8dae7c129cbbd 100644 (file)
@@ -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):