swiftlang / swift-corelibs-xctest

The XCTest Project, A Swift core library for providing unit test support
swift.org
Apache License 2.0
1.15k stars 267 forks source link

Make XCTestExpectation Sendable #414

Closed stmontgomery closed 2 years ago

stmontgomery commented 2 years ago

This makes the XCTestExpectation class hierarchy conform to Sendable. This class and its descendants are designed to be used concurrently and are already internally concurrency-safe, so this conformance formally permits them to be used in Swift Concurrency APIs which enforce sendability.

Includes a build-only test which has concurrency warnings enabled to validate the fix.

rdar://95746454

stmontgomery commented 2 years ago

@swift-ci Please test