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

Conversation

dnadoba
Copy link
Collaborator

@dnadoba dnadoba commented Jul 13, 2023

We have observed that AsyncAwaitEndToEndTests.testImmediateDeadline can also return a HTTPClientError.remoteConnectionClosed in rare circumstances. 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 which can execute before we push the previous error to the request state machine. We can't change this in the current architecture so we will just tolerate this error in tests as well.

The AsyncAwaitEndToEndTests.testDeadline() is less likely to experience this issue but I have changed it there too just to be safe.

@dnadoba
Copy link
Collaborator Author

dnadoba commented Jul 14, 2023

@swift-server-bot test this please

Test seems to have timed out:

[502/503] Testing AsyncHTTPClientTests.RequestBagTests/testCancelFailsTaskAfterRequestIsSent
Build timed out (after 10 minutes). Marking the build as failed.

Have added a timeout to the ELF.wait() in #699 to better debug this in the future. CI might also just got throttled as this is the second last test.

@dnadoba dnadoba merged commit 7935de1 into swift-server:main Jul 14, 2023
@dnadoba dnadoba deleted the dn-fix-flaky-test branch July 14, 2023 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants