FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: fix flaky test by cjihrig · Pull Request #23811 · nodejs/node · GitHub

/ node Public

test: fix flaky test - #23811

Closed
cjihrig wants to merge 1 commit into
nodejs:masterfrom
cjihrig:test-fix
Closed

test: fix flaky test#23811
cjihrig wants to merge 1 commit into
nodejs:masterfrom
cjihrig:test-fix

Conversation

cjihrig commented Oct 21, 2018

Copy link
Copy Markdown
Contributor

This commit fixes test-tls-set-secure-context.js. The test was making one long lasting HTTP connection, followed by a number of shorter lived connections. However, it was possible that the connections were not received in the desired order. This commit ensures that the long lasting connection is established before making any other connections.

Fixes: #23807

Before this change, the command tools/test.py -j 8 --repeat 1000 test/parallel/test-tls-set-secure-context.js failed approximately 1% of the time for me locally. With this change, I haven't seen a failure after two such runs.

cc: @targos

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Copy link
Copy Markdown
Collaborator

nodejs-github-bot added the test Issues and PRs related to the tests. label Oct 21, 2018

refack commented Oct 21, 2018
edited
Loading

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: I think we can simply call the function as it will just postpone itself anyway.

This commit fixes test-tls-set-secure-context.js. The test was
making one long lasting HTTP connection, followed by a number of
shorter lived connections. However, it was possible that the
connections were not received in the desired order. This commit
ensures that the long lasting connection is established before
making any other connections.
async function makeRemainingRequests() {
// Wait until the first request is guaranteed to have been handled.
if (!firstResponse) {
return setImmediate(makeRemainingRequests);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can we use a dummy EventEmitter to emit an event when firstResponse is set instead of polling for it and call makeRemainingRequests when the event is emitted?

lundibundi added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Oct 23, 2018

Copy link
Copy Markdown
Member

Trott pushed a commit to Trott/io.js that referenced this pull request Oct 24, 2018
This commit fixes test-tls-set-secure-context.js. The test was
making one long lasting HTTP connection, followed by a number of
shorter lived connections. However, it was possible that the
connections were not received in the desired order. This commit
ensures that the long lasting connection is established before
making any other connections.

PR-URL: nodejs#23811
Fixes: nodejs#23807
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

Trott commented Oct 24, 2018

Copy link
Copy Markdown
Member

Landed in b794f58.

@lpinca Regarding your comment: Nit that can be ignored? Or something that should be done in a subsequent PR? If more than a nit, you'll open the PR?

Trott closed this Oct 24, 2018

lpinca commented Oct 24, 2018

Copy link
Copy Markdown
Member

Yes, it can be ignored or addressed in another PR. Thank you.

cjihrig deleted the test-fix branch October 24, 2018 12:27
targos pushed a commit that referenced this pull request Oct 24, 2018
This commit fixes test-tls-set-secure-context.js. The test was
making one long lasting HTTP connection, followed by a number of
shorter lived connections. However, it was possible that the
connections were not received in the desired order. This commit
ensures that the long lasting connection is established before
making any other connections.

PR-URL: #23811
Fixes: #23807
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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 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 outstanding review comments, and a CI started. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate flaky test-tls-set-secure-context

8 participants


Back | FazBrowse Home | New Git URL