Bug 196260

Summary: [ews] Reset simctl states on reboot
Product: WebKit Reporter: Jonathan Bedard <jbedard>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, ap, commit-queue, lforschler, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Jonathan Bedard
Reported 2019-03-26 10:41:08 PDT
It's possible for simctl to get in a pretty rotten state, especially if folks change infrastructure code in a patch. On reboot, we should do everything we can to reset simctl to a pristine state.
Attachments
Patch (1.13 KB, patch)
2019-03-26 11:23 PDT, Jonathan Bedard
no flags
Patch for landing (1.14 KB, patch)
2019-03-26 13:01 PDT, Jonathan Bedard
no flags
Jonathan Bedard
Comment 1 2019-03-26 11:23:45 PDT
Aakash Jain
Comment 2 2019-03-26 11:46:45 PDT
Comment on attachment 365976 [details] Patch rs=me
Jonathan Bedard
Comment 3 2019-03-26 13:01:24 PDT
Created attachment 365990 [details] Patch for landing
WebKit Commit Bot
Comment 4 2019-03-26 13:42:04 PDT
Comment on attachment 365990 [details] Patch for landing Clearing flags on attachment: 365990 Committed r243516: <https://trac.webkit.org/changeset/243516>
WebKit Commit Bot
Comment 5 2019-03-26 13:42:06 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 6 2019-03-26 13:51:09 PDT
Alexey Proskuryakov
Comment 7 2019-03-26 14:17:55 PDT
Comment on attachment 365990 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=365990&action=review > Tools/EWSTools/start-queue-mac.sh:68 > +/usr/bin/sudo /usr/bin/killall -9 com.apple.CoreSimulator.CoreSimulatorServer > +/usr/bin/xcrun simctl delete unavailable How did you choose this order of operations? If CoreSimulatorServer is restarted automatically, then we would probably want to restart it after the state is clean, not before. Although there would be races either way I think.
Jonathan Bedard
Comment 8 2019-03-26 16:22:09 PDT
Comment on attachment 365990 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=365990&action=review >> Tools/EWSTools/start-queue-mac.sh:68 >> +/usr/bin/xcrun simctl delete unavailable > > How did you choose this order of operations? > > If CoreSimulatorServer is restarted automatically, then we would probably want to restart it after the state is clean, not before. Although there would be races either way I think. First we need to remove any corrupted devices (to do this, we remove all devices) Second, we need to force the CoreSimulatorServer to recognize our deletions (because it won't immediately) Last, we should remove any remaining devices that simctl thinks it has available, but aren't. This last step isn't strictly necessary to fix the problem which prompted this bug, but it's something we should have been doing in the first place. The trouble is, 'xcrun simctl delete unavailable' will fail if it tries to delete devices corrupted in a certain way.
Note You need to log in before you can comment on or make changes to this bug.