Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle --launch-timeout expiration with an appropriate exit code #855

Closed
Tracked by #9136
premun opened this issue Apr 8, 2022 · 0 comments · Fixed by #859
Closed
Tracked by #9136

Handle --launch-timeout expiration with an appropriate exit code #855

premun opened this issue Apr 8, 2022 · 0 comments · Fixed by #859
Labels
apple iOS/tvOS/WatchOS/Mac Catalyst area bug

Comments

@premun
Copy link
Member

premun commented Apr 8, 2022

Problem

For the following situation:

/tmp/helix/working/B4C3099A/w/B5B9096D/e/System.Private.Uri.Unit.Tests.app --output-directory /tmp/helix/working/B4C3099A/w/B5B9096D/uploads
XHarness command issued: apple test --app /tmp/helix/working/B4C3099A/w/B5B9096D/e/System.Private.Uri.Unit.Tests.app --output-directory /tmp/helix/working/B4C3099A/w/B5B9096D/uploads --target ios-simulator-64 --timeout 00:30:00 --xcode /Applications/Xcode115.app -v --launch-timeout 00:03:00
[03:36:48] info: Preparing run for ios-simulator-64
[03:36:49] info: Looking for available ios-simulator-64 simulators..
[03:36:49] dbug: Looking for available ios-simulator-64 simulators. Storing logs into list-ios-simulator-64-20220406_033649.log
[03:40:11] info: Found simulator device 'iPhone X (iOS 13.5) - created by XHarness'
[03:40:11] info: Getting app bundle information from '/tmp/helix/working/B4C3099A/w/B5B9096D/e/System.Private.Uri.Unit.Tests.app'..
[03:40:11] dbug: 
[03:40:11] dbug: Running /usr/libexec/PlistBuddy -c "Print CFBundleName" /tmp/helix/working/B4C3099A/w/B5B9096D/e/System.Private.Uri.Unit.Tests.app/Info.plist
[03:40:11] dbug: Process PlistBuddy exited with 137
[03:40:11] fail: Failed to get bundle information: Killing process 723 as it was cancelled
                 
[03:40:11] dbug: Saving diagnostics data to '/tmp/helix/working/B4C3099A/w/B5B9096D/e/diagnostics.json'
XHarness exit code: 4 (PACKAGE_NOT_FOUND)

What happened is that the aggressive --launch-timeout expired which stopped the process of reading app information.
The result of this run should be a launch timeout, launch failure or similar (something that will be retried).

Similarly, if looking for the device took longer and would be cancelled in the same way, we shouldn't report DEVICE_NOT_FOUND (not sure this is happening but all actions cancelled by this should result in a retriable exit code).

To be done

  • Consider the state of the launch timeout token when failures occur. This token eventually expires but if we manage to launch the app by then, we should stop taking it into account.
  • The orchestrator class should be checking for IsCancellationRequested in between the various operations and return a failing exit code as well so that we also implement part of the cancellation process and don't have to wait for ProcessManager calls to be cancelled.
@premun premun added bug apple iOS/tvOS/WatchOS/Mac Catalyst area labels Apr 8, 2022
@premun premun changed the title When --launch-timeout expires, XHarness should report appropriate exit code Handle --launch-timeout expiration with an appropriate exit code Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apple iOS/tvOS/WatchOS/Mac Catalyst area bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant