Skip to content

Commit 4e7153c

Browse files
authored
Merge pull request #479 from apple/jgrynspan/124112256-fulfillment-warning
Suppress Swift 6 concurrency warning when using `XCTWaiter` and `XCTestExpectation`.
2 parents aba63a7 + 90aafad commit 4e7153c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/XCTest/Public/Asynchronous/XCTWaiter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ open class XCTWaiter {
277277
/// swift-corelibs-xctest and Apple XCTest, it is not recommended to pass
278278
/// explicit values for `file` and `line`.
279279
@available(macOS 12.0, *)
280-
@discardableResult
280+
@discardableResult @_unsafeInheritExecutor
281281
open func fulfillment(of expectations: [XCTestExpectation], timeout: TimeInterval, enforceOrder: Bool = false, file: StaticString = #file, line: Int = #line) async -> Result {
282282
return await withCheckedContinuation { continuation in
283283
// This function operates by blocking a background thread instead of one owned by libdispatch or by the
@@ -327,7 +327,7 @@ open class XCTWaiter {
327327
/// expectations are not fulfilled before the given timeout. Default is the line
328328
/// number of the call to this method in the calling file. It is rare to
329329
/// provide this parameter when calling this method.
330-
@available(macOS 12.0, *)
330+
@available(macOS 12.0, *) @_unsafeInheritExecutor
331331
open class func fulfillment(of expectations: [XCTestExpectation], timeout: TimeInterval, enforceOrder: Bool = false, file: StaticString = #file, line: Int = #line) async -> Result {
332332
return await XCTWaiter().fulfillment(of: expectations, timeout: timeout, enforceOrder: enforceOrder, file: file, line: line)
333333
}

Sources/XCTest/Public/Asynchronous/XCTestCase+Asynchronous.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public extension XCTestCase {
110110
/// provide this parameter when calling this method.
111111
///
112112
/// - SeeAlso: XCTWaiter
113-
@available(macOS 12.0, *)
113+
@available(macOS 12.0, *) @_unsafeInheritExecutor
114114
func fulfillment(of expectations: [XCTestExpectation], timeout: TimeInterval, enforceOrder: Bool = false, file: StaticString = #file, line: Int = #line) async {
115115
let waiter = XCTWaiter(delegate: self)
116116
await waiter.fulfillment(of: expectations, timeout: timeout, enforceOrder: enforceOrder, file: file, line: line)

0 commit comments

Comments
 (0)