Add a sleep to fix ACI conversion tests

This ensures that the cache is cleared before the second request is made
This commit is contained in:
Joseph Schorr 2016-10-14 13:36:47 -04:00
parent 2174fe589b
commit c3ce491f02

View file

@ -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)