WebKit Bugzilla
Attachment 339604 Details for
Bug 185315
: Check for com.apple.datamigrator before declaring simulators booted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185315-20180504153828.patch (text/plain), 5.56 KB, created by
Jonathan Bedard
on 2018-05-04 15:38:28 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jonathan Bedard
Created:
2018-05-04 15:38:28 PDT
Size:
5.56 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 231384) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,26 @@ >+2018-05-04 Jonathan Bedard <jbedard@apple.com> >+ >+ Check for com.apple.datamigrator before declaring simulators booted >+ https://bugs.webkit.org/show_bug.cgi?id=185315 >+ <rdar://problem/39986261> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Scripts/webkitdirs.pm: >+ (waitUntilProcessNotRunning): Wait until a process is not found. >+ (relaunchIOSSimulator): Wait until com.apple.datamigrator stops running to declare >+ a simulator booted. >+ * Scripts/webkitpy/common/system/executive_mock.py: >+ (MockExecutive2.__init__): Define _running_pids. >+ * Scripts/webkitpy/xcode/simulated_device.py: >+ (SimulatedDeviceManager.initialize_devices): Call wait_until_data_migration_is_done before >+ declaring that devices have been booted, increase the timeout since data migration will frequently >+ take longer than 60 seconds, especially with multiple simulators booting. >+ (SimulatedDeviceManager.swap): Ditto. >+ (SimulatedDeviceManager): >+ (SimulatedDeviceManager.wait_until_data_migration_is_done): Wait until there are no com.apple.datamigrator >+ processes running. >+ > 2018-05-04 Timothy Hatcher <timothy@apple.com> > > Deprecate legacy WebView and friends >Index: Tools/Scripts/webkitdirs.pm >=================================================================== >--- Tools/Scripts/webkitdirs.pm (revision 231364) >+++ Tools/Scripts/webkitdirs.pm (working copy) >@@ -2451,6 +2451,14 @@ sub waitUntilIOSSimulatorDeviceIsInState > } > } > >+sub waitUntilProcessNotRunning($) >+{ >+ my ($process) = @_; >+ while (system("/bin/ps -eo pid,comm | /usr/bin/grep '$process'") == 0) { >+ usleep(500 * 1000); >+ } >+} >+ > sub shutDownIOSSimulatorDevice($) > { > my ($simulatorDevice) = @_; >@@ -2476,6 +2484,7 @@ sub relaunchIOSSimulator($) > system("open", "-a", $iosSimulatorPath, "--args", "-CurrentDeviceUDID", $simulatedDevice->{UDID}) == 0 or die "Failed to open $iosSimulatorPath: $!"; > > waitUntilIOSSimulatorDeviceIsInState($simulatedDevice->{UDID}, SIMULATOR_DEVICE_STATE_BOOTED); >+ waitUntilProcessNotRunning('com.apple.datamigrator'); > } > > sub quitIOSSimulator(;$) >Index: Tools/Scripts/webkitpy/common/system/executive_mock.py >=================================================================== >--- Tools/Scripts/webkitpy/common/system/executive_mock.py (revision 231364) >+++ Tools/Scripts/webkitpy/common/system/executive_mock.py (working copy) >@@ -178,6 +178,7 @@ class MockExecutive2(MockExecutive): > self._stderr = stderr > self._exit_code = exit_code > self._exception = exception >+ self._running_pids = {'test-webkitpy': os.getpid()} > self._run_command_fn = run_command_fn > self.calls = [] > >Index: Tools/Scripts/webkitpy/xcode/simulated_device.py >=================================================================== >--- Tools/Scripts/webkitpy/xcode/simulated_device.py (revision 231364) >+++ Tools/Scripts/webkitpy/xcode/simulated_device.py (working copy) >@@ -314,7 +314,7 @@ class SimulatedDeviceManager(object): > SimulatedDeviceManager.INITIALIZED_DEVICES.append(device) > > @staticmethod >- def initialize_devices(requests, host=SystemHost(), name_base='Managed', simulator_ui=True, timeout=60, **kwargs): >+ def initialize_devices(requests, host=SystemHost(), name_base='Managed', simulator_ui=True, timeout=180, **kwargs): > if SimulatedDeviceManager.INITIALIZED_DEVICES is not None: > return SimulatedDeviceManager.INITIALIZED_DEVICES > >@@ -365,6 +365,7 @@ class SimulatedDeviceManager(object): > deadline = time.time() + timeout > for device in SimulatedDeviceManager.INITIALIZED_DEVICES: > SimulatedDeviceManager._wait_until_device_in_state(device, SimulatedDevice.DeviceState.BOOTED, deadline) >+ SimulatedDeviceManager.wait_until_data_migration_is_done(host, deadline - time.time()) > > return SimulatedDeviceManager.INITIALIZED_DEVICES > >@@ -394,7 +395,7 @@ class SimulatedDeviceManager(object): > return min(max_supported_simulators_locally, max_supported_simulators_for_hardware) > > @staticmethod >- def swap(device, request, host=SystemHost(), name_base='Managed', timeout=60): >+ def swap(device, request, host=SystemHost(), name_base='Managed', timeout=180): > if SimulatedDeviceManager.INITIALIZED_DEVICES is None: > raise RuntimeError('Cannot swap when there are no initialized devices') > if device not in SimulatedDeviceManager.INITIALIZED_DEVICES: >@@ -415,6 +416,17 @@ class SimulatedDeviceManager(object): > > deadline = time.time() + timeout > SimulatedDeviceManager._wait_until_device_in_state(device, SimulatedDevice.DeviceState.BOOTED, deadline) >+ SimulatedDeviceManager.wait_until_data_migration_is_done(host, deadline - time.time()) >+ >+ @staticmethod >+ def wait_until_data_migration_is_done(host, timeout=180): >+ # The existence of a datamigrator process means that simulators are still booting. >+ deadline = time.time() + timeout >+ _log.debug('Waiting until no com.apple.datamigrator processes are found') >+ while host.executive.running_pids(lambda process_name: 'com.apple.datamigrator' in process_name): >+ if time.time() > deadline: >+ raise RuntimeError('Timed out while waiting for data migration') >+ time.sleep(1) > > @staticmethod > def tear_down(host=SystemHost(), timeout=60):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185315
:
339577
|
339604
|
339734