aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2012-08-31 00:29:20 +0000
committerRob Austein <sra@hactrn.net>2012-08-31 00:29:20 +0000
commit568f018e015fe698e6f6fdef95403d59b8602fbe (patch)
treec6a12f6a6ee3f74f7dc8086ed24b29a36f99afaa
parent8171c9ebe21f2181efc6192a9d189901b57c6708 (diff)
Tweak shutdown to give children more time to save profile data.
svn path=/branches/tk274/; revision=4679
-rw-r--r--rpkid/tests/yamltest.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/rpkid/tests/yamltest.py b/rpkid/tests/yamltest.py
index 2ae23f36..638d8027 100644
--- a/rpkid/tests/yamltest.py
+++ b/rpkid/tests/yamltest.py
@@ -752,18 +752,30 @@ try:
print
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
- for i in xrange(29):
- for p in progs:
- if p.poll() is None and i % 15 == 0:
- print "Politely nudging pid %d" % p.pid
- p.terminate()
+
+ if profile:
+ how_long = 300
+ else:
+ how_long = 30
+
+ how_often = how_long / 2
+
+ for i in xrange(how_long):
+ if i % how_often == 0:
+ for p in progs:
+ if p.poll() is None:
+ print "Politely nudging pid %d" % p.pid
+ p.terminate()
+ print
if all(p.poll() is not None for p in progs):
break
time.sleep(1)
+
for p in progs:
if p.poll() is None:
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())