RESOLVED FIXED 167654
Workaround for simctl install failing to report install failure
https://bugs.webkit.org/show_bug.cgi?id=167654
Summary Workaround for simctl install failing to report install failure
Jonathan Bedard
Reported 2017-01-31 11:24:29 PST
simctl launch has a known issue where it will sometimes report a successful install even though the install failed. We need to workaround this issue until it is fixed.
Attachments
Complete workaround (2.17 KB, patch)
2017-01-31 11:30 PST, Jonathan Bedard
no flags
Partial workaround (2.78 KB, patch)
2017-01-31 11:38 PST, Jonathan Bedard
no flags
Patch (3.10 KB, patch)
2017-01-31 14:30 PST, Jonathan Bedard
no flags
Patch (3.07 KB, patch)
2017-01-31 15:00 PST, Jonathan Bedard
no flags
Patch for landing (3.08 KB, patch)
2017-01-31 15:38 PST, Jonathan Bedard
no flags
Jonathan Bedard
Comment 1 2017-01-31 11:30:04 PST
Created attachment 300241 [details] Complete workaround
Jonathan Bedard
Comment 2 2017-01-31 11:32:27 PST
Comment on attachment 300241 [details] Complete workaround This workaround will recover from any recoverable bug in simctl install, but will take much longer to install an app in the event that any simctl install bug is encountered.
Jonathan Bedard
Comment 3 2017-01-31 11:38:43 PST
Created attachment 300242 [details] Partial workaround
Jonathan Bedard
Comment 4 2017-01-31 11:40:41 PST
Comment on attachment 300242 [details] Partial workaround This workaround will work if simctl launch never places the app in the target simulator's directory when it fails without warning. We have no evidence that this is how simctl launch fails. This patch, however, will take less time in the event that simctl launch does fail.
Jonathan Bedard
Comment 5 2017-01-31 11:41:35 PST
Comment on attachment 300241 [details] Complete workaround View in context: https://bugs.webkit.org/attachment.cgi?id=300241&action=review > Tools/Scripts/webkitpy/xcode/simulator.py:266 > def install_app(self, app_path): A comment pointing to the appropriate bug needs to be added
Jonathan Bedard
Comment 6 2017-01-31 13:53:12 PST
Comment on attachment 300242 [details] Partial workaround Bugs related to the issue we are working around indicate that an app may exist on simulator but still not entirely be installed. This workaround will still be susceptible to a failure of simctl install
Jonathan Bedard
Comment 7 2017-01-31 14:30:26 PST
Daniel Bates
Comment 8 2017-01-31 14:51:46 PST
Comment on attachment 300261 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=300261&action=review I am not happy that we have to use launching of a simulator app as a way to validate whether the install was successful. I wish there was a more direct way to test that installation succeeded. Even better, I wish that "simctl install" only returned a zero status (for success) after successful installing the app. > Tools/Scripts/webkitpy/xcode/simulator.py:267 > + # FIXME: This is a workaround for <rdar://problem/30273973>, Racey failure of simctl launch. The bug title for <rdar://problem/30273973> mentions "simctl launch". Is this the correct bug for this install_app workaround? > Tools/Scripts/webkitpy/xcode/simulator.py:270 > + break I would just return from here instead of breaking out of the loop. > Tools/Scripts/webkitpy/xcode/simulator.py:277 > + bundle_id = self._host.executive.run_command([ > + '/usr/libexec/PlistBuddy', > + '-c', > + 'Print CFBundleIdentifier', > + self._host.filesystem.join(app_path, 'Info.plist'), > + ]).rstrip() This duplicates the logic of the function you added in the patch for bug #165927 (https://trac.webkit.org/changeset/211370), DarwinPort.app_identifier_from_bundle(). > Tools/Scripts/webkitpy/xcode/simulator.py:278 > + pid = self.launch_app(bundle_id, [], attempts=1) I take it you find it variable name pid to be helpful in documenting that launch_app returns a process identifier? I would have inlined the right-hand side of this expression into the line below and avoid the need for the local variable pid. > Tools/Scripts/webkitpy/xcode/simulator.py:294 > + # FIXME: This is a workaround for <rdar://problem/30172453> Very Minor: Missing a period at the end of this sentence.
Jonathan Bedard
Comment 9 2017-01-31 14:58:20 PST
Comment on attachment 300261 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=300261&action=review >> Tools/Scripts/webkitpy/xcode/simulator.py:267 >> + # FIXME: This is a workaround for <rdar://problem/30273973>, Racey failure of simctl launch. > > The bug title for <rdar://problem/30273973> mentions "simctl launch". Is this the correct bug for this install_app workaround? Right radar, wrong title. Fixed. >> Tools/Scripts/webkitpy/xcode/simulator.py:277 >> + ]).rstrip() > > This duplicates the logic of the function you added in the patch for bug #165927 (https://trac.webkit.org/changeset/211370), DarwinPort.app_identifier_from_bundle(). Yes, it does. I thought this was the best solution, rather than refactoring the entire device class just to pass in a port rather than an executive. Hopefully, this fix is relatively short-lived.
Jonathan Bedard
Comment 10 2017-01-31 15:00:19 PST
WebKit Commit Bot
Comment 11 2017-01-31 15:30:18 PST
Comment on attachment 300266 [details] Patch Rejecting attachment 300266 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'validate-changelog', '--check-oops', '--non-interactive', 300266, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit Dan Bates found in /Volumes/Data/EWS/WebKit/Tools/ChangeLog does not appear to be a valid reviewer according to contributors.json. /Volumes/Data/EWS/WebKit/Tools/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive). Full output: http://webkit-queues.webkit.org/results/2981688
Jonathan Bedard
Comment 12 2017-01-31 15:38:31 PST
Created attachment 300274 [details] Patch for landing
WebKit Commit Bot
Comment 13 2017-01-31 16:17:09 PST
Comment on attachment 300274 [details] Patch for landing Clearing flags on attachment: 300274 Committed r211457: <http://trac.webkit.org/changeset/211457>
WebKit Commit Bot
Comment 14 2017-01-31 16:17:13 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.