Commit 1b8a5bf9 authored by Andrei Vagin's avatar Andrei Vagin Committed by Pavel Emelyanov

zdtm.py: print a process tree if a timeout is expired

It gives us more information why a test hasn't completed in time.
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent a007f53b
......@@ -317,10 +317,12 @@ def wait_pid_die(pid, who, tmo = 30):
except: # Died
break
print "Wait for %s to die for %f" % (who, stime)
print "Wait for %s(%d) to die for %f" % (who, pid, stime)
time.sleep(stime)
stime *= 2
else:
subprocess.Popen(["ps", "-p", str(pid)]).wait()
subprocess.Popen(["ps", "axf", str(pid)]).wait()
raise test_fail_exc("%s die" % who)
......@@ -439,6 +441,7 @@ class zdtm_test:
def kill(self, sig = signal.SIGKILL):
self.__freezer.thaw()
if self.__pid:
print "Send the %d signal to %s" % (sig, self.__pid)
os.kill(int(self.__pid), sig)
self.gone(sig == signal.SIGKILL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment