Changeset 220942 in webkit


Ignore:
Timestamp:
Aug 18, 2017 4:26:40 PM (7 years ago)
Author:
Jonathan Bedard
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.

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r220938 r220942  
     12017-08-18  Jonathan Bedard  <jbedard@apple.com>
     2
     3        Fix leak-checking for iOS Simulators
     4        https://bugs.webkit.org/show_bug.cgi?id=175735
     5
     6        Reviewed by Darin Adler.
     7
     8        If the leak checking currently occurs in ServerProcess, we can’t check leaks on an iOS
     9        Simulator (or device) because the process will have already been killed by the time we
     10        check for leaks. Duplicate leak-checking code and share code waiting on a process to stop.
     11
     12        * Scripts/webkitpy/port/server_process.py:
     13        (ServerProcess.stop): Move code waiting for the process to close to _wait_for_stop(...).
     14        (ServerProcess._wait_for_stop): Share code shutting down a process between ServerProcess
     15        and SimulatorProcess.
     16        * Scripts/webkitpy/port/simulator_process.py:
     17        (SimulatorProcess.stop): Before closing the process, check for leaks.
     18
    1192017-08-18  Eric Carlson  <eric.carlson@apple.com>
    220
  • trunk/Tools/Scripts/webkitpy/port/server_process.py

    r218055 r220942  
    349349            self._port.check_for_leaks(self.process_name(), self.pid())
    350350
    351         now = time.time()
    352351        if self._proc.stdin:
    353352            self._proc.stdin.close()
    354353            self._proc.stdin = None
     354
     355        return self._wait_for_stop(timeout_secs)
     356
     357    def _wait_for_stop(self, timeout_secs=3.0):
     358        now = time.time()
    355359        killed = False
    356360        if timeout_secs:
  • trunk/Tools/Scripts/webkitpy/port/simulator_process.py

    r220483 r220942  
    117117
    118118    def stop(self, timeout_secs=3.0):
     119        # Only bother to check for leaks or stderr if the process is still running.
     120        if self.poll() is None:
     121            self._port.check_for_leaks(self.process_name(), self.pid())
     122
    119123        if self._proc and self._proc.pid:
    120124            self._target_host.executive.kill_process(self._proc.pid)
    121         return super(SimulatorProcess, self).stop(timeout_secs)
     125
     126        return self._wait_for_stop(timeout_secs)
Note: See TracChangeset for help on using the changeset viewer.