aboutsummaryrefslogtreecommitdiff
path: root/rpkid/tests/yamltest.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2012-08-09 02:01:00 +0000
committerRob Austein <sra@hactrn.net>2012-08-09 02:01:00 +0000
commitf1ea21697f9ea7deb771df7a3710189f46b1f597 (patch)
tree198d75cc875b9bedd2f046acd484e5b6eef9de77 /rpkid/tests/yamltest.py
parentf8d0d3bbbfc06ab298e3eb379e6759e1c3c3c863 (diff)
Sometimes it takes more than one signal to get a subprocess to exit.
svn path=/branches/tk274/; revision=4624
Diffstat (limited to 'rpkid/tests/yamltest.py')
-rw-r--r--rpkid/tests/yamltest.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/rpkid/tests/yamltest.py b/rpkid/tests/yamltest.py
index ba89d007..2bcda77c 100644
--- a/rpkid/tests/yamltest.py
+++ b/rpkid/tests/yamltest.py
@@ -720,9 +720,19 @@ try:
print
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
+ for i in xrange(19):
+ for p in progs:
+ if p.poll() is None and i % 5 == 0:
+ print "Politely nudging pid %d" % p.pid
+ p.terminate()
+ if all(p.poll() is not None for p in progs):
+ break
+ time.sleep(1)
for p in progs:
if p.poll() is None:
- os.kill(p.pid, signal.SIGTERM)
+ print "Pulling the plug on pid %d" % p.pid
+ p.kill()
+ for p in progs:
print "Program pid %d %r returned %d" % (p.pid, p, p.wait())
finally: