Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
runwda can fail due to wda not starting up properly. I am not 100% sure why wda fails to launch, but if it does not launch then runwda should exit instead of just sitting there.
Before:
Note that wda failed to launch and called the local method
_XCT_didFailToBootstrapWithError
. If this function is called then I believe go-ios should abort runwda and just exit. In the above output I pressed ctrl-c, you can see the ^C there.After:
This PR adds a handler for that XCT message and tries to abort
runwda
. This is accomplished using the go context library, which is slightly different from how termination works in go-ios now. Instead of a channel dedicated to listening for signals, the various runXUITest* functions wait for a context to be closed. This can be accomplished through either the XCT failed message being received, or if the user sends a signal via ctrl-c or what have you.Let me know if using contexts is acceptable here, or if you have some other ideas for abnormal termination. Also I still have to test this code for an ios device that would use the RunXCUIWithBundleIds11, as my existing test case used ios 14.