Title: [220942] trunk/Tools
- Revision
- 220942
- Author
- [email protected]
- Date
- 2017-08-18 16:26:40 -0700 (Fri, 18 Aug 2017)
Log Message
Fix leak-checking for iOS Simulators
https://bugs.webkit.org/show_bug.cgi?id=175735
Reviewed by Darin Adler.
If the leak checking currently occurs in ServerProcess, we can’t check leaks on an iOS
Simulator (or device) because the process will have already been killed by the time we
check for leaks. Duplicate leak-checking code and share code waiting on a process to stop.
* Scripts/webkitpy/port/server_process.py:
(ServerProcess.stop): Move code waiting for the process to close to _wait_for_stop(...).
(ServerProcess._wait_for_stop): Share code shutting down a process between ServerProcess
and SimulatorProcess.
* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess.stop): Before closing the process, check for leaks.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (220941 => 220942)
--- trunk/Tools/ChangeLog 2017-08-18 23:24:59 UTC (rev 220941)
+++ trunk/Tools/ChangeLog 2017-08-18 23:26:40 UTC (rev 220942)
@@ -1,3 +1,21 @@
+2017-08-18 Jonathan Bedard <[email protected]>
+
+ Fix leak-checking for iOS Simulators
+ https://bugs.webkit.org/show_bug.cgi?id=175735
+
+ Reviewed by Darin Adler.
+
+ If the leak checking currently occurs in ServerProcess, we can’t check leaks on an iOS
+ Simulator (or device) because the process will have already been killed by the time we
+ check for leaks. Duplicate leak-checking code and share code waiting on a process to stop.
+
+ * Scripts/webkitpy/port/server_process.py:
+ (ServerProcess.stop): Move code waiting for the process to close to _wait_for_stop(...).
+ (ServerProcess._wait_for_stop): Share code shutting down a process between ServerProcess
+ and SimulatorProcess.
+ * Scripts/webkitpy/port/simulator_process.py:
+ (SimulatorProcess.stop): Before closing the process, check for leaks.
+
2017-08-18 Eric Carlson <[email protected]>
Add WTFLogChannel level to allow runtime log filtering
Modified: trunk/Tools/Scripts/webkitpy/port/server_process.py (220941 => 220942)
--- trunk/Tools/Scripts/webkitpy/port/server_process.py 2017-08-18 23:24:59 UTC (rev 220941)
+++ trunk/Tools/Scripts/webkitpy/port/server_process.py 2017-08-18 23:26:40 UTC (rev 220942)
@@ -348,10 +348,14 @@
if self.poll() is None:
self._port.check_for_leaks(self.process_name(), self.pid())
- now = time.time()
if self._proc.stdin:
self._proc.stdin.close()
self._proc.stdin = None
+
+ return self._wait_for_stop(timeout_secs)
+
+ def _wait_for_stop(self, timeout_secs=3.0):
+ now = time.time()
killed = False
if timeout_secs:
deadline = now + timeout_secs
Modified: trunk/Tools/Scripts/webkitpy/port/simulator_process.py (220941 => 220942)
--- trunk/Tools/Scripts/webkitpy/port/simulator_process.py 2017-08-18 23:24:59 UTC (rev 220941)
+++ trunk/Tools/Scripts/webkitpy/port/simulator_process.py 2017-08-18 23:26:40 UTC (rev 220942)
@@ -116,6 +116,11 @@
self._proc = SimulatorProcess.Popen(self._pid, stdin, stdout, stderr, self._target_host)
def stop(self, timeout_secs=3.0):
+ # Only bother to check for leaks or stderr if the process is still running.
+ if self.poll() is None:
+ self._port.check_for_leaks(self.process_name(), self.pid())
+
if self._proc and self._proc.pid:
self._target_host.executive.kill_process(self._proc.pid)
- return super(SimulatorProcess, self).stop(timeout_secs)
+
+ return self._wait_for_stop(timeout_secs)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes