A quite strange behaviour when using the await fulfillment(of: [exp])
final class XCtestPerformanceTests: XCTestCase {
func testWaitForValue_Exp() async {
let exp = expectation(description: "My Expectation")
Task {
exp.fulfill()
}
await fulfillment(of: [exp])
}
}
when using a timeout bigger than 0.1 sec many tests take around 0.1 sec to complete.
Test Case '-[XCtestPerformanceTests.XCtestPerformanceTests testWaitForValue_Exp]' started (Iteration 1 of 100).
Test Case '-[XCtestPerformanceTests.XCtestPerformanceTests testWaitForValue_Exp]' passed (0.001 seconds).
Test Case '-[XCtestPerformanceTests.XCtestPerformanceTests testWaitForValue_Exp]' started (Iteration 2 of 100).
Test Case '-[XCtestPerformanceTests.XCtestPerformanceTests testWaitForValue_Exp]' passed (0.106 seconds).
Test Case '-[XCtestPerformanceTests.XCtestPerformanceTests testWaitForValue_Exp]' started (Iteration 3 of 100).
Test Case '-[XCtestPerformanceTests.XCtestPerformanceTests testWaitForValue_Exp]' passed (0.105 seconds).
Test Case '-[XCtestPerformanceTests.XCtestPerformanceTests testWaitForValue_Exp]' started (Iteration 4 of 100).
Test Case '-[XCtestPerformanceTests.XCtestPerformanceTests testWaitForValue_Exp]' passed (0.001 seconds).
Test Case '-[XCtestPerformanceTests.XCtestPerformanceTests testWaitForValue_Exp]' started (Iteration 5 of 100).
Test Case '-[XCtestPerformanceTests.XCtestPerformanceTests testWaitForValue_Exp]' passed (0.001 seconds).
Test Case '-[XCtestPerformanceTests.XCtestPerformanceTests testWaitForValue_Exp]' started (Iteration 6 of 100).
Test Case '-[XCtestPerformanceTests.XCtestPerformanceTests testWaitForValue_Exp]' passed (0.104 seconds).
This repository tracks the open-source XCTest implementation used on Linux. For issues with the copy of XCTest that ships with Xcode on macOS, please file feedback using Apple's Feedback Assistant.
A quite strange behaviour when using the
await fulfillment(of: [exp])
when using a timeout bigger than 0.1 sec many tests take around 0.1 sec to complete.
Reproducible in Xcode: 15.0
Issue was not reproducible in Xcode 14.x