Uh oh!
There was an error while loading. Please reload this page.
test: deflake http-server-request-timeout test - #44169
Closed
nicksia-vgw wants to merge 1 commit into
Closed
Conversation
nicksia-vgwforce-pushed
the
fix-flaky-http-server-request-timeouts-test
branch
2 times, most recently
from
August 8, 2022 10:14
723159d to
86c0d69Compareparallel/http-server-request-timeouts-mixed test was sometimes failing due to insufficient tolerance between the connection timeout checking interval, and the expected timeout specified in the test. This change makes the checking interval more frequent, and decouples the timeout for the check from the checking interval. fixes: nodejs#43465
nicksia-vgwforce-pushed
the
fix-flaky-http-server-request-timeouts-test
branch
from
August 8, 2022 10:15
86c0d69 to
3c68bf1Comparelpinca
approved these changes
Aug 8, 2022
nodejs-github-bot
commented
Aug 8, 2022
Collaborator
This was referenced Aug 9, 2022
nodejs-github-bot
commented
Aug 10, 2022
Collaborator
Member
Superseds #43470. |
7 tasks
nodejs-github-bot
commented
Aug 11, 2022
Collaborator
This was referenced Aug 12, 2022
nicksia-vgw
commented
Aug 14, 2022
ContributorAuthor
Could I get a hand getting this merged please? |
MoLow
commented
Aug 14, 2022
Member
@nicksia-vgw I see this has still failed on osx: https://ci.nodejs.org/job/node-test-commit-osx/46808/ |
nicksia-vgw
commented
Aug 14, 2022
ContributorAuthor
Oh sorry - I missed that. Let me take a look. |
itsnicksia
commented
Aug 14, 2022
I think for timing sensitive tests like these, it might be more reliable when run as part of the sequential suite, to avoid issues caused by delays due to resource contention. Any concerns with merging this PR (it will reduce failure rate), then moving these failing tests to the sequential suite in a follow-up PR?
|
OK - I'm ready to merge. |
9 tasks
lpinca
commented
Aug 15, 2022
Member
Landed in b84a633. |
lpinca pushed a commit
that referenced
this pull request
Aug 15, 2022
parallel/test-http-server-request-timeouts-mixed.js test was sometimes failing due to insufficient tolerance between the connection timeout checking interval, and the expected timeout specified in the test. This change makes the checking interval more frequent, and decouples the timeout for the check from the checking interval. PR-URL: #44169 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
9 tasks
danielleadams pushed a commit
that referenced
this pull request
Aug 16, 2022
parallel/test-http-server-request-timeouts-mixed.js test was sometimes failing due to insufficient tolerance between the connection timeout checking interval, and the expected timeout specified in the test. This change makes the checking interval more frequent, and decouples the timeout for the check from the checking interval. PR-URL: #44169 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This was referenced Aug 17, 2022
ruyadorno pushed a commit
that referenced
this pull request
Aug 23, 2022
parallel/test-http-server-request-timeouts-mixed.js test was sometimes failing due to insufficient tolerance between the connection timeout checking interval, and the expected timeout specified in the test. This change makes the checking interval more frequent, and decouples the timeout for the check from the checking interval. PR-URL: #44169 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
juanarbol
commented
Sep 30, 2022
Member
This depends on #42893, which is marked as "dont-land-on-v16.x". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
parallel/http-server-request-timeouts-mixed test was sometimes failing due to insufficient tolerance between the connection timeout checking interval, and the expected timeout specified in the test.
The checking interval was 500ms, and the request was checked for timeout exactly 500ms after the request was expected to timeout. This led to a timing condition where the next check would occur slightly after the request was expected to timeout.
Detailed Explanation
Timings
headersTimeout: 2000msrequestTimeout: 4000msconnectionsCheckingInterval: 500msRequest 2 is started at
headersTimeout * 0.2, or400ms.Headers time out 2000ms after that.
Completion of Request 2 is checked at at
headersTimeout * 1.2 + connectionsCheckingInterval, or2900ms.Timeline
@[400ms]: Request 2 client created and first write sent.
@[2400ms]: Headers are timed out.
@[2900ms]: Request 2 completion is checked (which is intended to depend on Request 2 expiring via headersTimeout, as seen in the comment -
assert(request2.response.startsWith(responseTimeout)); // It is expired due to headersTimeout.The problem is that the connectionsCheckingInterval is slightly too high. The connection checking interval could tick just after 2400ms, and then just after 2900ms.
Example
The fix is to ensure connection checking interval is less than 500ms, and to decouple the check timeout from connection checking interval.