summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-02-21 00:33:36 +0000
committerGerrit Code Review <review@openstack.org>2013-02-21 00:33:36 +0000
commit71bb43d4dcd00ae1ceb59bdc4dd8e40239455dd2 (patch)
tree8789a5f57849de20264989d1e0391a35fb51e91d
parente6c25d17b498ff7e5a6e2f2710916ffe979ee3d3 (diff)
parentdd57befcbd5e45100eb4f03a94cc8cbd1943bfe2 (diff)
downloadnova-71bb43d4dcd00ae1ceb59bdc4dd8e40239455dd2.tar.gz
nova-71bb43d4dcd00ae1ceb59bdc4dd8e40239455dd2.tar.xz
nova-71bb43d4dcd00ae1ceb59bdc4dd8e40239455dd2.zip
Merge "More gracefully handle TimeoutException in test"
-rw-r--r--nova/tests/integrated/test_multiprocess_api.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/nova/tests/integrated/test_multiprocess_api.py b/nova/tests/integrated/test_multiprocess_api.py
index 855f702ba..91e37116d 100644
--- a/nova/tests/integrated/test_multiprocess_api.py
+++ b/nova/tests/integrated/test_multiprocess_api.py
@@ -16,6 +16,7 @@
"""
Test multiprocess enabled API service.
"""
+import fixtures
import os
import signal
import time
@@ -94,8 +95,16 @@ class MultiprocessWSGITest(integrated_helpers._IntegratedTestBase):
# Make sure all processes are stopped
os.kill(self.pid, signal.SIGTERM)
- # Make sure we reap our test process
- self._reap_test()
+ try:
+ # Make sure we reap our test process
+ self._reap_test()
+ except fixtures.TimeoutException:
+ # If the child gets stuck or is too slow in existing
+ # after receiving the SIGTERM, gracefully handle the
+ # timeout exception and try harder to kill it. We need
+ # to do this otherwise the child process can hold up
+ # the test run
+ os.kill(self.pid, signal.SIGKILL)
super(MultiprocessWSGITest, self).tearDown()