From abe58fe334b0fd8d4806c0d8081cd74f4feafef3 Mon Sep 17 00:00:00 2001 From: Feilong Wang Date: Fri, 19 Jun 2020 17:45:47 +1200 Subject: [PATCH] Fix HTTP 400 error This is kind of a race condition issue, Tempest is doing a wait and check when it is trying to delete a cluster. However, at the very end of the cluster deletion process, a cluster GET request may get a HTTP 400 error which will cause the Tempest case failed. This HTTP 400 exception reported by a cluster GET request should be caught and take cluster as still existing. Task: 40120 Story: 2007833 Change-Id: Ic97abf8d4d584f35b18bff9eab5d3e5ac80c0f02 --- magnum_tempest_plugin/tests/api/v1/clients/cluster_client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/magnum_tempest_plugin/tests/api/v1/clients/cluster_client.py b/magnum_tempest_plugin/tests/api/v1/clients/cluster_client.py index 77066ea..786e628 100755 --- a/magnum_tempest_plugin/tests/api/v1/clients/cluster_client.py +++ b/magnum_tempest_plugin/tests/api/v1/clients/cluster_client.py @@ -171,4 +171,9 @@ class ClusterClient(client.MagnumClient): except exceptions.NotFound: self.LOG.warning('Cluster %s is not found.', cluster_id) return True + except exceptions.BadRequest: + self.LOG.warning('Cluster %s returned a bad state. Assuming ' + 'temporary failure and the cluster still exists.', + cluster_id) + return False return False