-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
async
XCTest execution on Darwin when the runner's main
is `a…
…sync`. There is what appears to be a strange bug on Darwin platforms here. If the calling context (e.g., `main`) is `async` and there are any `async` tests in the suite to be run, calling `XCTestSuite.run()` will cause the test process to terminate abnormally with the error "freed pointer was not the last allocation" out of the Swift runtime. We "avoid" (work around) this by wrapping the call in a detached task and then awaiting its result. The task must be detached so that we don't block the main actor, which the tests may also be depending on. PiperOrigin-RevId: 662944537
- Loading branch information
1 parent
722ec91
commit d7f555d
Showing
2 changed files
with
16 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d7f555d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1443