Skip to content

Commit 9548fa2

Browse files
authored
Silence a concurrency warning on Linux/Windows building an actor-isolated 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.
1 parent 70f173e commit 9548fa2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Diff for: Tests/TestingTests/KnownIssueTests.swift

+7-6
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,13 @@ final class KnownIssueTests: XCTestCase {
376376

377377
await fulfillment(of: [issueRecorded, knownIssueNotRecorded], timeout: 0.0)
378378
}
379+
}
379380

380-
@MainActor
381-
func testMainActorIsolated() async {
382-
await Test {
383-
await withKnownIssue(isIntermittent: true) { () async in }
384-
}.run(configuration: .init())
385-
}
381+
@MainActor
382+
@Test("withKnownIssue {} with main actor isolation")
383+
func mainActorIsolatedKnownIssue() async {
384+
await Test {
385+
await withKnownIssue(isIntermittent: true) { () async in }
386+
}.run(configuration: .init())
386387
}
387388
#endif

0 commit comments

Comments
 (0)