tests: kill worker pids as well on timeouts
Workers that don't exit can also trigger a timeout, and we want our test environment to be super robust - kill them aggressively too. Also raise the timeout error so that we don't mask this when it happens. Change-Id: Iee606720f98e9a5e8a11f162eb885c0a00a2345e Partial-Bug: #1357578
This commit is contained in:
parent
f804ce594a
commit
4acf31fb3a
|
@ -105,10 +105,9 @@ class MultiprocessWSGITest(integrated_helpers._IntegratedTestBase):
|
||||||
self.pid)
|
self.pid)
|
||||||
os.kill(self.pid, signal.SIGTERM)
|
os.kill(self.pid, signal.SIGTERM)
|
||||||
|
|
||||||
self._wait_for_all_workers_to_end()
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Make sure we reap our test process
|
# Make sure we reap our test process
|
||||||
|
self._wait_for_all_workers_to_end()
|
||||||
self._reap_test()
|
self._reap_test()
|
||||||
except fixtures.TimeoutException:
|
except fixtures.TimeoutException:
|
||||||
# If the child gets stuck or is too slow in exiting
|
# If the child gets stuck or is too slow in exiting
|
||||||
|
@ -117,9 +116,14 @@ class MultiprocessWSGITest(integrated_helpers._IntegratedTestBase):
|
||||||
# to do this otherwise the child process can hold up
|
# to do this otherwise the child process can hold up
|
||||||
# the test run
|
# the test run
|
||||||
LOG.warn("got fixtures.TimeoutException during tearDown(). "
|
LOG.warn("got fixtures.TimeoutException during tearDown(). "
|
||||||
"going nuclear with a SIGKILL on launcher pid %d.",
|
"going nuclear with SIGKILL.")
|
||||||
self.pid)
|
for worker_pid in self._get_workers():
|
||||||
|
LOG.warn("worker pid %d" % worker_pid)
|
||||||
|
os.kill(worker_pid, signal.SIGKILL)
|
||||||
|
|
||||||
|
LOG.warn("parent pid %d" % self.pid)
|
||||||
os.kill(self.pid, signal.SIGKILL)
|
os.kill(self.pid, signal.SIGKILL)
|
||||||
|
raise
|
||||||
|
|
||||||
super(MultiprocessWSGITest, self).tearDown()
|
super(MultiprocessWSGITest, self).tearDown()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue