From 70d2e4bc6dcfa2aed1b2eda3b6937d99c590e12a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Thu, 7 Jul 2011 15:18:27 +0200
Subject: [PATCH] Setup process group for test suite.

Thanks to this registration to process_group_pid_set allows cleanup of test
suite too.

If something else is left behind, those are disconnected processes of test
suite itself, which shall be cleared in that one.
---
 slapos/recipe/erp5testnode/testnode.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/slapos/recipe/erp5testnode/testnode.py b/slapos/recipe/erp5testnode/testnode.py
index ce115f8b7..623c6658b 100644
--- a/slapos/recipe/erp5testnode/testnode.py
+++ b/slapos/recipe/erp5testnode/testnode.py
@@ -255,7 +255,8 @@ branch = %(branch)s
           # XXX: is it good for all cases (eg: test runner fails too early for
           # any custom code to pick the failure up and react ?)
           remote_test_result_needs_cleanup = False
-          run_test_suite = subprocess.Popen(invocation_list)
+          run_test_suite = subprocess.Popen(invocation_list,
+            preexec_fn=os.setsid)
           process_group_pid_set.add(run_test_suite.pid)
           run_test_suite.wait()
           process_group_pid_set.remove(run_test_suite.pid)
-- 
2.30.9