Skip to content
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

test: fix flaky HTTP server tests #42846

Conversation

tniessen
Copy link
Member

@tniessen tniessen commented Apr 24, 2022

These two tests have been causing lots of CI failures, both in Jenkins and GitHub actions. They incorrectly use common.platformTimeout(), which scales a given amount of time by a factor that depends on the platform. However, these tests compute some times as common.platformTimeout(x * common.platformTimeout(y)), effectively squaring the platform-dependent factor.

I also increased the base timeout from 1000ms to 2000ms. As a reference, I ran one of the tests (test-http-server-headers-timeout-keepalive.js) with different base timeouts, 8000 times each, using 200 concurrent processes across 16 cores.

base timeout successful success rate
500ms 7676 95.95 %
600ms 7911 98.89 %
800ms 7944 99.30 %
1000ms 7989 99.86 %
2000ms 7999 99.99 %

Refs: #41263
Fixes: #42741

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Apr 24, 2022
@tniessen tniessen added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 24, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 24, 2022
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@austinkelleher austinkelleher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tniessen tniessen added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 24, 2022
@tniessen
Copy link
Member Author

The test-macOS GitHub action keeps failing on the master branch so I'll propose to fast-track this since I'm confident it will significantly reduce CI failures.

@tniessen tniessen added the fast-track PRs that do not need to wait for 48 hours to land. label Apr 24, 2022
@github-actions
Copy link
Contributor

Fast-track has been requested by @tniessen. Please 👍 to approve.

Copy link
Contributor

@RaisinTen RaisinTen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is supposed to fix the flakiness entirely, I think we should add Fixes: https://github.com/nodejs/node/issues/42741 to the description. Otherwise, maybe rename the PR to test: reduce flakiness in HTTP server tests?

@tniessen
Copy link
Member Author

If this is supposed to fix the flakiness entirely, I think we should add Fixes: https://github.com/nodejs/node/issues/42741 to the description. Otherwise, maybe rename the PR to test: reduce flakiness in HTTP server tests?

I wasn't aware of the open issue. Edited the description in the hope that this will fix the flakiness.

Copy link
Contributor

@ShogunPanda ShogunPanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I had the fix for this in another PR which will take a while for me to land.

This one is even better, LGTM!

@tniessen tniessen added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 24, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 24, 2022
@nodejs-github-bot nodejs-github-bot merged commit 0288844 into nodejs:master Apr 24, 2022
@nodejs-github-bot
Copy link
Collaborator

Landed in 0288844

xtx1130 pushed a commit to xtx1130/node that referenced this pull request Apr 25, 2022
Refs: nodejs#41263

PR-URL: nodejs#42846
Fixes: nodejs#42741
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
targos pushed a commit that referenced this pull request Apr 28, 2022
Refs: #41263

PR-URL: #42846
Fixes: #42741
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
@targos targos mentioned this pull request May 2, 2022
juanarbol pushed a commit that referenced this pull request May 31, 2022
Refs: #41263

PR-URL: #42846
Fixes: #42741
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
@danielleadams
Copy link
Contributor

@tniessen this doesn't land cleanly in v16.x-staging - do you mind backporting this to v16.x?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. fast-track PRs that do not need to wait for 48 hours to land. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate flaky test-http-server-request-timeout-keepalive
10 participants