Wait all children, not only the first one
This commit is contained in:
parent
a55a08b840
commit
e2cc2a633c
@ -307,7 +307,11 @@ class ServiceManager(object):
|
||||
os.killpg(0, signal.SIGTERM)
|
||||
|
||||
LOG.debug("Waiting services to terminate")
|
||||
os.waitpid(-1, 0)
|
||||
while True:
|
||||
try:
|
||||
os.waitpid(0, 0)
|
||||
except OSError:
|
||||
break
|
||||
|
||||
LOG.debug("Shutdown finish")
|
||||
_logged_sys_exit(0)
|
||||
|
@ -140,6 +140,8 @@ class TestCotyledon(base.TestCase):
|
||||
os.kill(self.subp.pid, signal.SIGTERM)
|
||||
self.subp.terminate()
|
||||
lines = self.get_lines()
|
||||
self.assertEqual(b'DEBUG:cotyledon:Shutdown finish',
|
||||
lines[-1])
|
||||
time.sleep(0.5)
|
||||
lines = sorted(self.hide_pids(lines))
|
||||
self.assertEqual([
|
||||
|
Loading…
Reference in New Issue
Block a user