Title: [214965] trunk/Tools
Revision
214965
Author
[email protected]
Date
2017-04-05 13:17:37 -0700 (Wed, 05 Apr 2017)

Log Message

webkitpy: Add pid logging for simulator processes
https://bugs.webkit.org/show_bug.cgi?id=170505

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess._start.handler): Add pid to exception.
(SimulatorProcess._start): Ditto.
* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice.launch_app): Log pid when the process fails to launch and when
a pid is successfully returned.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (214964 => 214965)


--- trunk/Tools/ChangeLog	2017-04-05 20:16:47 UTC (rev 214964)
+++ trunk/Tools/ChangeLog	2017-04-05 20:17:37 UTC (rev 214965)
@@ -1,3 +1,17 @@
+2017-04-05  Jonathan Bedard  <[email protected]>
+
+        webkitpy: Add pid logging for simulator processes
+        https://bugs.webkit.org/show_bug.cgi?id=170505
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Scripts/webkitpy/port/simulator_process.py:
+        (SimulatorProcess._start.handler): Add pid to exception.
+        (SimulatorProcess._start): Ditto.
+        * Scripts/webkitpy/xcode/simulated_device.py:
+        (SimulatedDevice.launch_app): Log pid when the process fails to launch and when
+        a pid is successfully returned.
+
 2017-04-05  Ryan Haddad  <[email protected]>
 
         Unreviewed, rolling out r214932.

Modified: trunk/Tools/Scripts/webkitpy/port/simulator_process.py (214964 => 214965)


--- trunk/Tools/Scripts/webkitpy/port/simulator_process.py	2017-04-05 20:16:47 UTC (rev 214964)
+++ trunk/Tools/Scripts/webkitpy/port/simulator_process.py	2017-04-05 20:17:37 UTC (rev 214965)
@@ -94,7 +94,7 @@
 
         def handler(signum, frame):
             assert signum == signal.SIGALRM
-            raise Exception('Timed out waiting for process to connect at port {}'.format(self._target_host.listening_port()))
+            raise Exception('Timed out waiting for pid {} to connect at port {}'.format(self._pid, self._target_host.listening_port()))
         signal.signal(signal.SIGALRM, handler)
         signal.alarm(6)  # In seconds
 
@@ -111,7 +111,7 @@
             self._proc = SimulatorProcess.Popen(self._pid, stdin, stdout, stderr, self._target_host)
             if self._proc.poll() is not None:
                 self._reset()
-                raise Exception('App {} crashed before stdin could be attached'.format(os.path.basename(self._cmd[0])))
+                raise Exception('App {} with pid {} crashed before stdin could be attached'.format(os.path.basename(self._cmd[0]), self._pid))
             self._kill()
             self._reset()
             raise

Modified: trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py (214964 => 214965)


--- trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py	2017-04-05 20:16:47 UTC (rev 214964)
+++ trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py	2017-04-05 20:17:37 UTC (rev 214965)
@@ -187,11 +187,16 @@
             # FIXME: We shouldn't need to check the PID <rdar://problem/31154075>.
             if match and self.executive.check_running_pid(int(match.group('pid'))):
                 break
+            if match:
+                _log.debug('simctl launch reported pid {}, but this process is not running'.format(match.group('pid')))
+            else:
+                _log.debug('simctl launch did not report a pid')
 
         signal.alarm(0)  # Cancel alarm
 
         if match.group('bundle') != bundle_id:
             raise RuntimeError('Failed to find process id for {}: {}'.format(bundle_id, output))
+        _log.debug('Returning pid {} of launched process'.format(match.group('pid')))
         return int(match.group('pid'))
 
     def __eq__(self, other):
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to