Skip to content

[6.0.1] Remove @MainActor from XCTest glue. #7960

New issue

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

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

Already on GitHub? # to your account

Conversation

grynspan
Copy link
Contributor

Explanation: Remove @MainActor annotations from corelibs-xctest glue functions that are no longer needed.
Scope: corelibs-xctest glue code
Issue: N/A
Original PR: N/A
Risk: Unknown
Testing: Existing CI jobs
Reviewer: @bnbarham @briancroom @DougGregor @shahmishal

@grynspan grynspan added bug concurrency swift test Changes impacting `swift test` tool swift 6.0 Related to Swift 6.0 release branch labels Sep 11, 2024
@grynspan grynspan self-assigned this Sep 11, 2024
@grynspan grynspan requested a review from a team as a code owner September 11, 2024 18:11
grynspan added a commit to swiftlang/swift-testing that referenced this pull request Sep 11, 2024
…ated test.

We have one `@MainActor`, `async` test on a non-sendable `XCTestCase` subclass.
Not surprisingly, this doesn't work fantastically well. Move the test out of the
class to fix the resulting compiler diagnostic.

Related to swiftlang/swift-package-manager#7960.
grynspan added a commit to swiftlang/swift-testing that referenced this pull request Sep 11, 2024
…ated test. (#680)

We have one `@MainActor`, `async` test on a non-sendable `XCTestCase`
subclass. Not surprisingly, this doesn't work fantastically well. Move
the test out of the class to fix the resulting compiler diagnostic.

Related to swiftlang/swift-package-manager#7960.

### Checklist:

- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
@shahmishal
Copy link
Member

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan changed the title [6.0.0] Remove @MainActor from XCTest glue. [6.0.1] Remove @MainActor from XCTest glue. Sep 17, 2024
@grynspan grynspan changed the base branch from release/6.0.0 to release/6.0.1 September 17, 2024 14:05
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan merged commit 0f9a6e3 into release/6.0.1 Sep 17, 2024
5 checks passed
@grynspan grynspan deleted the jgrynspan/remove-main-actor-isolation-from-xctest-glue-6.0.0 branch September 17, 2024 19:11
grynspan added a commit that referenced this pull request Sep 26, 2024
Removes `@MainActor` and adds `nonisolated(unsafe)` to suppress
concurrency diagnostics in the XCTest glue code generated when using
corelibs-xctest.

See also #7960.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug concurrency swift test Changes impacting `swift test` tool swift 6.0 Related to Swift 6.0 release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants