diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2018-07-06 13:15:59 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2018-07-06 13:15:59 -0500 |
| commit | 26c268a910eaa9a36112aff0c38892759057c351 (patch) | |
| tree | c893e7a9efd4fe0ea17161a17d1ec46db90b859a /openstackclient/tests/functional | |
| parent | c5a0c3ad5dff4cd59c16104e3c419aae6a8e91d9 (diff) | |
| download | python-openstackclient-26c268a910eaa9a36112aff0c38892759057c351.tar.gz | |
Slow down and retry aggregate create/delete to lessen race
Change-Id: I676894c1bfd3156313d88e6457250b9ff226118b
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
Diffstat (limited to 'openstackclient/tests/functional')
| -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 + ' ' + |
