Skip to content

Remove @MainActor from XCTest glue. #7967

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

Merged

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Sep 17, 2024

Removes @MainActor and adds nonisolated(unsafe) to suppress concurrency diagnostics in the XCTest glue code generated when using corelibs-xctest.

See also #7960.

Removes `@MainActor` and adds `nonisolated(unsafe)` to suppress concurrency
diagnostics in the XCTest glue code generated when using corelibs-xctest.
@grynspan
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I have a radar which is going to be fixed by this, I'll try to find it.

@dschaefer2
Copy link
Member

@swift-ci please test windows

@grynspan grynspan enabled auto-merge (squash) September 17, 2024 19:11
@grynspan
Copy link
Contributor Author

@swift-ci test Windows

@dschaefer2
Copy link
Member

Test failure on Windows, thought it seems to be in the foundation tests...

@MaxDesiatov
Copy link
Contributor

@swift-ci test windows

@grynspan
Copy link
Contributor Author

images

@grynspan
Copy link
Contributor Author

@swift-ci test Windows

@grynspan
Copy link
Contributor Author

@swift-ci test Windows

grynspan added a commit to swiftlang/swift-corelibs-foundation that referenced this pull request Sep 24, 2024
SPM and swift-corelibs-xctest do not support main-actor-isolated tests unless they are marked `async` because the compilation stage that finds tests is not actor-aware. This test is preventing us from merging swiftlang/swift-package-manager#7967.
@grynspan
Copy link
Contributor Author

@swift-ci test

1 similar comment
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan merged commit 06f8984 into main Sep 26, 2024
5 checks passed
@grynspan grynspan deleted the jgrynspan/remove-main-actor-isolation-from-xctest-glue branch September 26, 2024 18:16
grynspan added a commit that referenced this pull request Sep 27, 2024
**Explanation:** Remove `@MainActor` annotations from corelibs-xctest
glue functions that are no longer needed.
**Scope:** corelibs-xctest glue code
**Issue:** [N/A](rdar://130066460)
**Original PR:**
#7967
**Risk:** Unknown
**Testing:** Existing CI jobs
**Reviewer:** @bnbarham @briancroom @DougGregor @shahmishal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug concurrency swift test Changes impacting `swift test` tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants