summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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()