tests: kill process group on failure

Test suite is often leaving `stray` processes on failure. They are
harmless, but may cause future test runs fail because those `stray`
processes are occupying `common.PORT` or due to some other reasons.

Killing whole process group on test suite failure should help in such
cases.
This commit is contained in:
Fedor Indutny 2012-02-20 22:03:14 +06:00
parent de5e3f6a6f
commit 0cebfc8ddb

View File

@ -1437,4 +1437,10 @@ def Main():
if __name__ == '__main__':
sys.exit(Main())
ret = 0
try:
ret = Main()
sys.exit(ret)
finally:
if ret and not utils.IsWindows():
os.killpg(0, signal.SIGKILL)