diff options
| author | Zuul <zuul@review.openstack.org> | 2018-07-13 17:57:25 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2018-07-13 17:57:25 +0000 |
| commit | ee35409069b0f77984e912cfc0c90cb9cce52512 (patch) | |
| tree | 2a3e40ae3185f489b2ca7cd2f5e56e56f1821462 /openstackclient | |
| parent | bf52ae5a5886784ebb857f8efdf32e2e487000a1 (diff) | |
| parent | 26c268a910eaa9a36112aff0c38892759057c351 (diff) | |
| download | python-openstackclient-ee35409069b0f77984e912cfc0c90cb9cce52512.tar.gz | |
Merge "Slow down and retry aggregate create/delete to lessen race"
Diffstat (limited to 'openstackclient')
| -rw-r--r-- | openstackclient/tests/functional/compute/v2/test_aggregate.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/openstackclient/tests/functional/compute/v2/test_aggregate.py b/openstackclient/tests/functional/compute/v2/test_aggregate.py index cf9d2bc0..71026757 100644 --- a/openstackclient/tests/functional/compute/v2/test_aggregate.py +++ b/openstackclient/tests/functional/compute/v2/test_aggregate.py @@ -11,6 +11,7 @@ # under the License. import json +import time import uuid from openstackclient.tests.functional import base @@ -51,6 +52,23 @@ class AggregateTests(base.TestCase): cmd_output['availability_zone'] ) + # Loop a few times since this is timing-sensitive + # Just hard-code it for now, since there is no pause and it is + # racy we shouldn't have to wait too long, a minute seems reasonable + wait_time = 0 + while wait_time < 60: + cmd_output = json.loads(self.openstack( + 'aggregate show -f json ' + + name2 + )) + if cmd_output['name'] != name2: + # Hang out for a bit and try again + print('retrying aggregate check') + wait_time += 10 + time.sleep(10) + else: + break + del_output = self.openstack( 'aggregate delete ' + name1 + ' ' + |
