From b473e2d498ddf48b6b088105b6a98d8f9ffe528a Mon Sep 17 00:00:00 2001 From: Feilong Wang Date: Fri, 19 Oct 2018 11:43:45 +1300 Subject: [PATCH] Fix the slowest test This patch is going to fix the k8s test gate for Magnum: 1. Given the test case test_create_list_sign_delete_clusters is the slowest test case, we better add the Tempest 'slow' tag for it. 2. Raise the timeout from 1800s to 3600s 3. Fix a wrong method calling Change-Id: I074434b3100178cba19b1f2f20da792871bb8530 --- .../tests/api/v1/clients/cluster_client.py | 6 +++--- magnum_tempest_plugin/tests/api/v1/test_cluster.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) 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 8505ed6..6ecc8e1 100755 --- a/magnum_tempest_plugin/tests/api/v1/clients/cluster_client.py +++ b/magnum_tempest_plugin/tests/api/v1/clients/cluster_client.py @@ -118,7 +118,7 @@ class ClusterClient(client.MagnumClient): def wait_for_created_cluster(self, cluster_id, delete_on_error=True): try: utils.wait_for_condition( - lambda: self.does_cluster_exist(cluster_id), 10, 1800) + lambda: self.does_cluster_exist(cluster_id), 10, 3600) except Exception: # In error state. Clean up the cluster id if desired self.LOG.error('Cluster %s entered an exception state.', @@ -131,7 +131,7 @@ class ClusterClient(client.MagnumClient): def wait_for_final_state(self, cluster_id): utils.wait_for_condition( - lambda: self.is_cluster_in_final_state(cluster_id), 10, 1800) + lambda: self.is_cluster_in_final_state(cluster_id), 10, 3600) def is_cluster_in_final_state(self, cluster_id): try: @@ -156,7 +156,7 @@ class ClusterClient(client.MagnumClient): self.LOG.error('Cluster %s is in fail state.', cluster_id) raise exceptions.ServerFault( - "Got into an error condition: %s for %s", + "Got into an error condition: %s for %s" % (model.status, cluster_id)) else: return False diff --git a/magnum_tempest_plugin/tests/api/v1/test_cluster.py b/magnum_tempest_plugin/tests/api/v1/test_cluster.py index 66878fb..a231ba7 100755 --- a/magnum_tempest_plugin/tests/api/v1/test_cluster.py +++ b/magnum_tempest_plugin/tests/api/v1/test_cluster.py @@ -68,7 +68,7 @@ class ClusterTest(base.BaseTempestTest): # NOTE (dimtruck) by default tempest sets timeout to 20 mins. # We need more time. - test_timeout = 1800 + test_timeout = 3600 self.useFixture(fixtures.Timeout(test_timeout, gentle=True)) except Exception: self.tearDown() @@ -133,6 +133,7 @@ class ClusterTest(base.BaseTempestTest): # (dimtruck) Combining all these tests in one because # they time out on the gate (2 hours not enough) @testtools.testcase.attr('positive') + @testtools.testcase.attr('slow') def test_create_list_sign_delete_clusters(self): gen_model = datagen.valid_cluster_data( cluster_template_id=self.cluster_template.uuid, node_count=1)