diff options
| author | TommyLike <tommylikehu@gmail.com> | 2017-06-15 09:31:00 +0800 |
|---|---|---|
| committer | TommyLike <tommylikehu@gmail.com> | 2017-06-16 10:27:35 +0800 |
| commit | afa10404bc6d94596b1b9c3c69d85c46e67b2d34 (patch) | |
| tree | 0df2969887870c1f58310df1fedb8b9af03e5c28 /cinderclient/tests/functional/base.py | |
| parent | 728e13442d4c57fc26eb81f884c3951f01767613 (diff) | |
| download | python-cinderclient-afa10404bc6d94596b1b9c3c69d85c46e67b2d34.tar.gz | |
[Optimize] Adds interval and increase waiting time
Gives more time to wait resource's status to change
in functional testcases and adds default interval
to reduce query amount.
Change-Id: I2a29a2d04836fd1261d45e404341bb1aa657417b
Diffstat (limited to 'cinderclient/tests/functional/base.py')
| -rw-r--r-- | cinderclient/tests/functional/base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cinderclient/tests/functional/base.py b/cinderclient/tests/functional/base.py index cff88c0..349bd1e 100644 --- a/cinderclient/tests/functional/base.py +++ b/cinderclient/tests/functional/base.py @@ -108,7 +108,7 @@ class ClientTestBase(base.ClientTestBase): return (object_name + '-' + cmd if object_name != 'volume' else cmd) def wait_for_object_status(self, object_name, object_id, status, - timeout=60): + timeout=120, interval=3): """Wait until object reaches given status. :param object_name: object name @@ -121,6 +121,7 @@ class ClientTestBase(base.ClientTestBase): while time.time() - start_time < timeout: if status in self.cinder(cmd, params=object_id): break + time.sleep(interval) else: self.fail("%s %s did not reach status %s after %d seconds." % (object_name, object_id, status, timeout)) |
