diff --git a/zaqar/tests/unit/transport/websocket/v2/test_claims.py b/zaqar/tests/unit/transport/websocket/v2/test_claims.py index 3505a762c..1f386e0bc 100644 --- a/zaqar/tests/unit/transport/websocket/v2/test_claims.py +++ b/zaqar/tests/unit/transport/websocket/v2/test_claims.py @@ -340,7 +340,11 @@ class ClaimsBaseTest(base.V1_1Base): message_id_3 = resp['body']['messages'][0]['id'] estimated_age = timeutils.delta_seconds(creation, query) - self.assertTrue(estimated_age > resp['body']['age']) + # The claim's age should be 0 at this moment. But in some unexpected + # case, such as slow test, the age maybe larger than 0. Just skip + # asserting if so. + if resp['body']['age'] == 0: + self.assertGreater(estimated_age, resp['body']['age']) # Delete the claim action = consts.CLAIM_DELETE diff --git a/zaqar/tests/unit/transport/wsgi/v2_0/test_subscriptions.py b/zaqar/tests/unit/transport/wsgi/v2_0/test_subscriptions.py index 65eb690de..0a3315c6f 100644 --- a/zaqar/tests/unit/transport/wsgi/v2_0/test_subscriptions.py +++ b/zaqar/tests/unit/transport/wsgi/v2_0/test_subscriptions.py @@ -282,6 +282,10 @@ class TestSubscriptionsMongoDB(base.V2Base): self.assertEqual(falcon.HTTP_200, self.srmock.status) next_subscriptions_list = jsonutils.loads(resp[0])['subscriptions'] self.assertEqual(5, len(next_subscriptions_list)) + # The subscriptions's age should be 0 at this moment. But in some + # unexpected case, such as slow test, the age maybe larger than 0. + self.assertGreaterEqual(next_subscriptions_list[0].pop('age'), + subscriptions_list[10].pop('age')) self.assertEqual(subscriptions_list[10], next_subscriptions_list[0]) def test_get_works(self):