From 1a9806b17f815453ca21c668dcdf85ab26278228 Mon Sep 17 00:00:00 2001 From: Corey O'Brien Date: Wed, 3 Feb 2016 11:01:05 -0500 Subject: [PATCH] Fix gate issues with functional-api job Prevents etcdctl from hanging when etcd has not started by explictly specifying connection timeouts. Reduce swarm build time by removing the unneccessary dependency between masters and nodes. Only create 1 node instead of 2 nodes Remove test_update_bay_name_for_existing_bay Change-Id: If6724497b47247d2858b6da90309949f92314cfb Closes-Bug: 1541105 --- .../fragments/write-swarm-agent-service.sh | 6 +++++- magnum/templates/swarm/swarmcluster.yaml | 1 - magnum/tests/functional/api/v1/test_bay.py | 21 ++----------------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/magnum/templates/swarm/fragments/write-swarm-agent-service.sh b/magnum/templates/swarm/fragments/write-swarm-agent-service.sh index 6fb806615e..ffbbbe6293 100644 --- a/magnum/templates/swarm/fragments/write-swarm-agent-service.sh +++ b/magnum/templates/swarm/fragments/write-swarm-agent-service.sh @@ -41,7 +41,11 @@ SCRIPT=/usr/local/bin/notify-heat cat > $SCRIPT << EOF #!/bin/sh -until etcdctl --peers $ETCD_SERVER_IP:2379 ls /v2/keys/swarm/docker/swarm/nodes/$myip:2375 +until etcdctl \ + --peers $ETCD_SERVER_IP:2379 \ + --timeout 1s \ + --total-timeout 5s \ + ls /v2/keys/swarm/docker/swarm/nodes/$myip:2375 do echo "Waiting for swarm agent registration..." sleep 5 diff --git a/magnum/templates/swarm/swarmcluster.yaml b/magnum/templates/swarm/swarmcluster.yaml index 44f9acd132..6b2a7b649b 100644 --- a/magnum/templates/swarm/swarmcluster.yaml +++ b/magnum/templates/swarm/swarmcluster.yaml @@ -299,7 +299,6 @@ resources: type: "OS::Heat::ResourceGroup" depends_on: - extrouter_inside - - swarm_masters properties: count: {get_param: number_of_nodes} resource_def: diff --git a/magnum/tests/functional/api/v1/test_bay.py b/magnum/tests/functional/api/v1/test_bay.py index 29dd6f0d5b..0d754194fb 100644 --- a/magnum/tests/functional/api/v1/test_bay.py +++ b/magnum/tests/functional/api/v1/test_bay.py @@ -106,7 +106,8 @@ class BayTest(base.BaseMagnumTest): # they time out on the gate (2 hours not enough) @testtools.testcase.attr('positive') def test_create_list_and_delete_bays(self): - gen_model = datagen.valid_bay_data(baymodel_id=self.baymodel.uuid) + gen_model = datagen.valid_bay_data( + baymodel_id=self.baymodel.uuid, node_count=1) _, temp_model = self._create_bay(gen_model) resp, model = self.bay_client.list_bays() self.assertEqual(resp.status, 200) @@ -139,24 +140,6 @@ class BayTest(base.BaseMagnumTest): exceptions.BadRequest, self.bay_client.post_bay, gen_model) - @testtools.testcase.attr('negative') - def test_update_bay_baymodel_name_for_existing_bay(self): - first_model = datagen.valid_bay_data(baymodel_id=self.baymodel.uuid, - name='test') - _, old_model = self._create_bay(first_model) - - patch_model = datagen.bay_name_patch_data() - self.assertRaises( - exceptions.BadRequest, - self.bay_client.patch_bay, - old_model.uuid, patch_model) - - patch_baymodel = datagen.baymodel_name_patch_data() - self.assertRaises( - exceptions.BadRequest, - self.baymodel_client.patch_baymodel, - self.baymodel.uuid, patch_baymodel) - @testtools.testcase.attr('negative') def test_update_bay_for_nonexisting_bay(self): patch_model = datagen.bay_name_patch_data()