8000 Fix flaky `AsyncAwaitEndToEndTests.testImmediateDeadline` test by dnadoba · Pull Request #698 · swift-server/async-http-client · GitHub
[go: up one dir, main page]

Skip to content

Fix flaky AsyncAwaitEndToEndTests.testImmediateDeadline test #698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2023
Merged
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
12 changes: 8 additions & 4 deletions Tests/AsyncHTTPClientTests/AsyncAwaitEndToEndTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,10 @@ final class AsyncAwaitEndToEndTests: XCTestCase {
guard let error = error as? HTTPClientError else {
return XCTFail("unexpected error \(error)")
}
// a race between deadline and connect timer can result in either error
XCTAssertTrue([.deadlineExceeded, .connectTimeout].contains(error))
// a race between deadline and connect timer can result in either error.
// If closing happens really fast we might shutdown the pipeline before we fail the request.
// If the pipeline is closed we may receive a `.remoteConnectionClosed`.
XCTAssertTrue([.deadlineExceeded, .connectTimeout, .remoteConnectionClosed].contains(error), "unexpected error \(error)")
}
}
}
Expand All @@ -412,8 +414,10 @@ final class AsyncAwaitEndToEndTests: XCTestCase {
guard let error = error as? HTTPClientError else {
return XCTFail("unexpected error \(error)")
}
// a race between deadline and connect timer can result in either error
XCTAssertTrue([.deadlineExceeded, .connectTimeout].contains(error), "unexpected error \(error)")
// a race between deadline and connect timer can result in either error.
// If closing happens really fast we might shutdown the pipeline before we fail the request.
// If the pipeline is closed we may receive a `.remoteConnectionClosed`.
XCTAssertTrue([.deadlineExceeded, .connectTimeout, .remoteConnectionClosed].contains(error), "unexpected error \(error)")
}
}
}
Expand Down
0