Merge "Fix race condition for image test"

This commit is contained in:
Zuul 2021-02-11 02:21:43 +00:00 committed by Gerrit Code Review
commit bf5a9eef5c
2 changed files with 22 additions and 18 deletions

View File

@ -110,20 +110,30 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
Creating another server image when first image is being saved is Creating another server image when first image is being saved is
not allowed. not allowed.
""" """
# Create first snapshot try:
image = self.create_image_from_server(self.server_id) # Create first snapshot
self.addCleanup(self._reset_server) image = self.create_image_from_server(self.server_id)
self.addCleanup(self._reset_server)
# Create second snapshot # Create second snapshot
self.assertRaises(lib_exc.Conflict, self.create_image_from_server, self.assertRaises(lib_exc.Conflict, self.create_image_from_server,
self.server_id) self.server_id)
if api_version_utils.compare_version_header_to_response( if api_version_utils.compare_version_header_to_response(
"OpenStack-API-Version", "compute 2.45", image.response, "lt"): "OpenStack-API-Version", "compute 2.45", image.response, "lt"):
image_id = image['image_id'] image_id = image['image_id']
else: else:
image_id = data_utils.parse_image_id(image.response['location']) image_id = data_utils.parse_image_id(
self.client.delete_image(image_id) image.response['location'])
self.client.delete_image(image_id)
except lib_exc.TimeoutException as ex:
# Test cannot capture the image saving state.
# If timeout is reached, we don't need to check state,
# since, it wouldn't be a 'SAVING' state atleast and apart from
# it, this testcase doesn't have scope for other state transition
# Hence, skip the test.
raise self.skipException("This test is skipped because " + str(ex))
@decorators.attr(type=['negative']) @decorators.attr(type=['negative'])
@decorators.idempotent_id('084f0cbc-500a-4963-8a4e-312905862581') @decorators.idempotent_id('084f0cbc-500a-4963-8a4e-312905862581')

View File

@ -11,9 +11,3 @@ tempest.api.object_storage
tempest.scenario.test_object_storage_basic_ops.TestObjectStorageBasicOps.test_swift_basic_ops tempest.scenario.test_object_storage_basic_ops.TestObjectStorageBasicOps.test_swift_basic_ops
tempest.scenario.test_object_storage_basic_ops.TestObjectStorageBasicOps.test_swift_acl_anonymous_download tempest.scenario.test_object_storage_basic_ops.TestObjectStorageBasicOps.test_swift_acl_anonymous_download
tempest.scenario.test_volume_backup_restore.TestVolumeBackupRestore.test_volume_backup_restore tempest.scenario.test_volume_backup_restore.TestVolumeBackupRestore.test_volume_backup_restore
# Skip test scenario when creating second image from instance
# https://bugs.launchpad.net/tripleo/+bug/1881592
# The test is most likely wrong and may fail if the fists image is create quickly.
# FIXME: Either fix the test so it won't race or consider if we should cover the scenario at all.
tempest.api.compute.images.test_images_oneserver_negative.ImagesOneServerNegativeTestJSON.test_create_second_image_when_first_image_is_being_saved