Bug 1236770 - Intermittent TEST-UNEXPECTED-ERROR | damp,ts_paint,tps,a11yr,tresize | psutil.NoSuchProcess process no longer exists (pid=3740, name=u'firefox.exe'). r=jmaher, a=test-only
authorBrad Lassey <blassey@mozilla.com>
Thu, 09 Feb 2017 21:49:47 -0500
changeset 378843 84df58250aaa030ecde8573105f307735467da28
parent 378842 71c2104babb740214d5803687337e6cb3b8978f8
child 378844 e695a8e2017a7e5d828f75c4e320b98ab3bb212a
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher, test-only
bugs1236770
milestone53.0a2
Bug 1236770 - Intermittent TEST-UNEXPECTED-ERROR | damp,ts_paint,tps,a11yr,tresize | psutil.NoSuchProcess process no longer exists (pid=3740, name=u'firefox.exe'). r=jmaher, a=test-only
testing/talos/talos/talos_process.py
--- a/testing/talos/talos/talos_process.py
+++ b/testing/talos/talos/talos_process.py
@@ -29,17 +29,25 @@ class ProcessContext(object):
 
     def kill_process(self):
         """
         Kill the process, returning the exit code or None if the process
         is already finished.
         """
         if self.process and self.process.is_running():
             LOG.debug("Terminating %s" % self.process)
-            self.process.terminate()
+            try:
+                self.process.terminate()
+            except psutil.NoSuchProcess:
+                procs = self.process.children()
+                for p in procs:
+                    c = ProcessContext()
+                    c.process = p
+                    c.kill_process()
+                return self.process.returncode
             try:
                 return self.process.wait(3)
             except psutil.TimeoutExpired:
                 self.process.kill()
                 # will raise TimeoutExpired if unable to kill
                 return self.process.wait(3)