Skip to content

Commit

Permalink
Merge pull request #479 from apple/jgrynspan/124112256-fulfillment-wa…
Browse files Browse the repository at this point in the history
…rning

Suppress Swift 6 concurrency warning when using `XCTWaiter` and `XCTestExpectation`.
  • Loading branch information
najacque authored Mar 27, 2024
2 parents aba63a7 + 90aafad commit 4e7153c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/XCTest/Public/Asynchronous/XCTWaiter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ open class XCTWaiter {
/// swift-corelibs-xctest and Apple XCTest, it is not recommended to pass
/// explicit values for `file` and `line`.
@available(macOS 12.0, *)
@discardableResult
@discardableResult @_unsafeInheritExecutor
open func fulfillment(of expectations: [XCTestExpectation], timeout: TimeInterval, enforceOrder: Bool = false, file: StaticString = #file, line: Int = #line) async -> Result {
return await withCheckedContinuation { continuation in
// This function operates by blocking a background thread instead of one owned by libdispatch or by the
Expand Down Expand Up @@ -327,7 +327,7 @@ open class XCTWaiter {
/// expectations are not fulfilled before the given timeout. Default is the line
/// number of the call to this method in the calling file. It is rare to
/// provide this parameter when calling this method.
@available(macOS 12.0, *)
@available(macOS 12.0, *) @_unsafeInheritExecutor
open class func fulfillment(of expectations: [XCTestExpectation], timeout: TimeInterval, enforceOrder: Bool = false, file: StaticString = #file, line: Int = #line) async -> Result {
return await XCTWaiter().fulfillment(of: expectations, timeout: timeout, enforceOrder: enforceOrder, file: file, line: line)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public extension XCTestCase {
/// provide this parameter when calling this method.
///
/// - SeeAlso: XCTWaiter
@available(macOS 12.0, *)
@available(macOS 12.0, *) @_unsafeInheritExecutor
func fulfillment(of expectations: [XCTestExpectation], timeout: TimeInterval, enforceOrder: Bool = false, file: StaticString = #file, line: Int = #line) async {
let waiter = XCTWaiter(delegate: self)
await waiter.fulfillment(of: expectations, timeout: timeout, enforceOrder: enforceOrder, file: file, line: line)
Expand Down

0 comments on commit 4e7153c

Please sign in to comment.