summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Riedemann <mriedem@us.ibm.com>2016-08-15 17:53:31 -0400
committerMatt Riedemann <mriedem@us.ibm.com>2016-08-15 17:53:31 -0400
commit56ee58403411652eba066f14c61f917e4d51a02c (patch)
tree8e28f2dfc6faeb835e79b59f351e6366df7a0d41
parent1adabce8bf83950daca136dbd54d2b0b80868d1a (diff)
downloadpython-novaclient-56ee58403411652eba066f14c61f917e4d51a02c.tar.gz
Make wait_for_server_os_boot wait longer
When running the trigger crash dump functional tests on a local devstack VM running with 4VCPUs and 8GB RAM, I'm getting timeouts after 60s waiting for the guest OS to boot. The gate jobs use VMs with 8VCPUs and 8GB RAM, which is fine, but we shouldn't require people to have a VM that size just to run novaclient functional tests reliably. While debugging, I verified that the guest OS is booting, it's just not done in 60 seconds. This change bumps the timeout to 300 seconds, which is the default that Tempest uses for waiting for a server to complete building. It also adds the last console output from the guest to the error message for debugging if/when this fails. Change-Id: I36d43c6e87839856740b2317ee57858ce6357051 Closes-Bug: #1613454
-rw-r--r--novaclient/tests/functional/base.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/novaclient/tests/functional/base.py b/novaclient/tests/functional/base.py
index 5d3f95e0..09a710fd 100644
--- a/novaclient/tests/functional/base.py
+++ b/novaclient/tests/functional/base.py
@@ -258,7 +258,7 @@ class ClientTestBase(testtools.TestCase):
self.fail("Volume %s did not reach status %s after %d s"
% (volume.id, status, timeout))
- def wait_for_server_os_boot(self, server_id, timeout=60,
+ def wait_for_server_os_boot(self, server_id, timeout=300,
poll_interval=1):
"""Wait until instance's operating system is completely booted.
@@ -267,13 +267,15 @@ class ClientTestBase(testtools.TestCase):
:param poll_interval: poll interval in seconds
"""
start_time = time.time()
+ console = None
while time.time() - start_time < timeout:
- if BOOT_IS_COMPLETE in self.nova('console-log %s ' % server_id):
+ console = self.nova('console-log %s ' % server_id)
+ if BOOT_IS_COMPLETE in console:
break
time.sleep(poll_interval)
else:
- self.fail("Server %s did not boot after %d s"
- % (server_id, timeout))
+ self.fail("Server %s did not boot after %d s.\nConsole:\n%s"
+ % (server_id, timeout, console))
def wait_for_resource_delete(self, resource, manager,
timeout=60, poll_interval=1):