Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ class HTTPBodyOutputStreamBridgeTests: XCTestCase {
XCTAssertNil(inputStream.streamError)

// Check the output stream closes gracefully in response to the input stream closing.
HTTPBodyOutputStreamBridge.streamQueue.asyncAndWait {
XCTAssertEqual(requestStream.outputStream.streamStatus, .closed)
XCTAssertNil(requestStream.outputStream.streamError)
}
HTTPBodyOutputStreamBridge.streamQueue.asyncAndWait(
execute: DispatchWorkItem {
XCTAssertEqual(requestStream.outputStream.streamStatus, .closed)
XCTAssertNil(requestStream.outputStream.streamError)
}
)
}

func testHTTPBodyOutputStreamBridgeBackpressure() async throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class URLSessionBidirectionalStreamingTests: XCTestCase {
// Just count the bytes received and verify the total matches what the server sent.
case count
// Add some artificial delay to simulate business logic to show how the backpressure mechanism works (or not).
case delay(Duration)
case delay(TimeAmount)
}

func testStreamingDownload(
Expand Down Expand Up @@ -387,7 +387,7 @@ class URLSessionBidirectionalStreamingTests: XCTestCase {
for try await receivedResponseChunk in responseBody! {
print("Client received some response body bytes (numBytes: \(receivedResponseChunk.count))")
print("Client doing fake work for \(delay)s")
try await Task.sleep(for: delay)
try await Task.sleep(nanoseconds: UInt64(delay.nanoseconds))
}
}

Expand Down