Commit e1293bbf authored by Thomas Miedema's avatar Thomas Miedema
Browse files

Testsuite: only print msg when timeout kills process unexpectedly

Differential Revision: https://phabricator.haskell.org/D1207
parent b639c977
...@@ -1798,6 +1798,10 @@ def rawSystemWithTimeout(cmd_and_args): ...@@ -1798,6 +1798,10 @@ def rawSystemWithTimeout(cmd_and_args):
if r == 98: if r == 98:
# The python timeout program uses 98 to signal that ^C was pressed # The python timeout program uses 98 to signal that ^C was pressed
stopNow() stopNow()
if r == 99 and getTestOpts().exit_code != 99:
# Only print a message when timeout killed the process unexpectedly.
cmd = cmd_and_args[-1]
if_verbose(1, 'Timeout happened...killed process "{}"...\n'.format(cmd))
return r return r
# cmd is a complex command in Bourne-shell syntax # cmd is a complex command in Bourne-shell syntax
......
...@@ -35,8 +35,6 @@ try: ...@@ -35,8 +35,6 @@ try:
else: else:
# parent # parent
def handler(signum, frame): def handler(signum, frame):
msg = 'Timeout happened...killing process %s...\n' % cmd
sys.stderr.write(msg)
killProcess(pid) killProcess(pid)
sys.exit(99) sys.exit(99)
old = signal.signal(signal.SIGALRM, handler) old = signal.signal(signal.SIGALRM, handler)
......
Supports Markdown
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