You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Motivation
The tests fail to compile on anything older than macOS 13, because they
use a number of APIs only available in macOS 13+:
- `Duration`
- `Task.sleep(for:)`
- `DispatchQueue.asyncAndWait` (closure variant)
### Modifications
Use the following APIs instead:
- `NIO.TimeInterval` (we have NIO dependency in tests already).
- `Task.sleep(nanoseconds:)`
- `DispatchQueue.asyncAndWait(execute:)`
### Result
Tests can be built on older platforms.
Copy file name to clipboardExpand all lines: Tests/OpenAPIURLSessionTests/URLSessionBidirectionalStreamingTests/URLSessionBidirectionalStreamingTests.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -305,7 +305,7 @@ class URLSessionBidirectionalStreamingTests: XCTestCase {
305
305
// Just count the bytes received and verify the total matches what the server sent.
306
306
case count
307
307
// Add some artificial delay to simulate business logic to show how the backpressure mechanism works (or not).
308
-
case delay(Duration)
308
+
case delay(TimeAmount)
309
309
}
310
310
311
311
func testStreamingDownload(
@@ -387,7 +387,7 @@ class URLSessionBidirectionalStreamingTests: XCTestCase {
0 commit comments