This matches a behavior change made in the Xcode copy of XCTest and allows tests which call XCTestCase.expectation(description:) — as well as other XCTestCase APIs that return an XCTestExpectation — to do so from any thread. This removes a previous requirement that tests call these APIs from the main thread, and it allows existing tests using them to adopt async without requiring @MainActor.
This matches a behavior change made in the Xcode copy of XCTest and allows tests which call
XCTestCase.expectation(description:)
— as well as otherXCTestCase
APIs that return anXCTestExpectation
— to do so from any thread. This removes a previous requirement that tests call these APIs from the main thread, and it allows existing tests using them to adoptasync
without requiring@MainActor
.rdar://85344643 rdar://79163972 rdar://81024086