[Lldb-commits] [lldb] r238421 - Cleanup the forked child in TestChangeProcessGroup

Pavel Labath labath at google.com
Thu May 28 06:12:48 PDT 2015


Author: labath
Date: Thu May 28 08:12:48 2015
New Revision: 238421

URL: http://llvm.org/viewvc/llvm-project?rev=238421&view=rev
Log:
Cleanup the forked child in TestChangeProcessGroup

if the test fails for some reason, we can end up leaking a process. This has a tendency to
confuse the buildbots. I have added a cleanup hook to make sure we cleanup the child.

Modified:
    lldb/trunk/test/functionalities/process_group/TestChangeProcessGroup.py

Modified: lldb/trunk/test/functionalities/process_group/TestChangeProcessGroup.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/process_group/TestChangeProcessGroup.py?rev=238421&r1=238420&r2=238421&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/process_group/TestChangeProcessGroup.py (original)
+++ lldb/trunk/test/functionalities/process_group/TestChangeProcessGroup.py Thu May 28 08:12:48 2015
@@ -65,6 +65,14 @@ class ChangeProcessGroupTestCase(TestBas
         self.assertTrue(err.Success() and retcode == 0,
                 "Failed to read file %s: %s, retcode: %d" % (pid_file_path, err.GetCString(), retcode))
 
+        # make sure we cleanup the forked child also
+        def cleanupChild():
+            if lldb.remote_platform:
+                lldb.remote_platform.Kill(int(pid))
+            else:
+                if os.path.exists("/proc/" + pid):
+                    os.kill(int(pid), signal.SIGKILL)
+        self.addTearDownHook(cleanupChild)
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)





More information about the lldb-commits mailing list