From c3ce491f02595910fbc6a5b7d87ff46daf4e15f9 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Fri, 14 Oct 2016 13:36:47 -0400 Subject: [PATCH] Add a sleep to fix ACI conversion tests This ensures that the cache is cleared before the second request is made --- test/registry_tests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/registry_tests.py b/test/registry_tests.py index 1a320f40d..075b761fc 100644 --- a/test/registry_tests.py +++ b/test/registry_tests.py @@ -38,7 +38,7 @@ from endpoints.csrf import generate_csrf_token from endpoints.v1 import v1_bp from endpoints.v2 import v2_bp from endpoints.verbs import verbs -from image.docker.schema1 import DockerSchema1ManifestBuilder, DockerSchema1Manifest +from image.docker.schema1 import DockerSchema1ManifestBuilder from initdb import wipe_database, initialize_database, populate_database from jsonschema import validate as validate_schema from util.security.registry_jwt import decode_bearer_header @@ -1927,6 +1927,9 @@ class ACIConversionTests(RegistryTestCaseMixin, V1RegistryPushMixin, LiveServerT # new generation of the image. self.conduct('POST', '/__test/clearderivedcache') + # Ensures the generated signature will be different. + time.sleep(1) + _, converted_again = self.get_converted_image() second_hash = hashlib.sha256(converted_again).hexdigest() self.assertEquals(second_hash, first_hash)