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 http-client-timeout-option-listeners #10224

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Dec 11, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test http

Description of change

test-http-client-timeout-option-listeners is flaky due to depending on
completing operations before a 100ms socket timeout. The socket timeout
is an integral part of the test. Load on the machine can affect the
test, so move it to sequential.

@Trott Trott added http Issues or PRs related to the http subsystem. test Issues and PRs related to the tests. labels Dec 11, 2016
@nodejs-github-bot nodejs-github-bot added dont-land-on-v7.x test Issues and PRs related to the tests. labels Dec 11, 2016
@Trott
Copy link
Member Author

Trott commented Dec 11, 2016

Sample failure on CI:

https://ci.nodejs.org/job/node-test-commit-freebsd/5810/nodes=freebsd11-x64/console

not ok 465 parallel/test-http-client-timeout-option-listeners
  ---
  duration_ms: 0.551
  severity: fail
  stack: |-
    
    assert.js:85
      throw new assert.AssertionError({
      ^
    AssertionError: 0 === 1
        at common.mustCall (/usr/home/iojs/build/workspace/node-test-commit-freebsd/nodes/freebsd11-x64/test/parallel/test-http-client-timeout-option-listeners.js:24:12)
        at /usr/home/iojs/build/workspace/node-test-commit-freebsd/nodes/freebsd11-x64/test/common.js:416:15
        at _combinedTickCallback (internal/process/next_tick.js:71:11)
        at process._tickCallback (internal/process/next_tick.js:98:9)
  ...

@Trott
Copy link
Member Author

Trott commented Dec 11, 2016

On my machine, at least, this results in the test reliably failing, demonstrating that concurrency negatively impacts the test:

tools/test.py -j 32 test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js test/parallel/test-http-client-timeout-option-listeners.js

@Trott
Copy link
Member Author

Trott commented Dec 11, 2016

Error when failing with the above command is strikingly similar to the failure in CI, suggesting a similar cause:

assert.js:85
  throw new assert.AssertionError({
  ^
AssertionError: 0 === 1
    at common.mustCall (/Users/trott/io.js/test/parallel/test-http-client-timeout-option-listeners.js:26:14)
    at /Users/trott/io.js/test/common.js:416:15
    at _combinedTickCallback (internal/process/next_tick.js:71:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

@Trott
Copy link
Member Author

Trott commented Dec 11, 2016

@santigimeno
Copy link
Member

The changes LGTM. As an alternative, what about setting a very large timeout? Do you think it makes sense?

diff --git a/test/parallel/test-http-client-timeout-option-listeners.js b/test/parallel/test-http-client-timeout-option-listeners.js
index 3ac6cd4..5e0f521 100644
--- a/test/parallel/test-http-client-timeout-option-listeners.js
+++ b/test/parallel/test-http-client-timeout-option-listeners.js
@@ -15,7 +15,7 @@ const options = {
   port: undefined,
   host: common.localhostIPv4,
   path: '/',
-  timeout: common.platformTimeout(100)
+  timeout: 2147483647
 };

@Trott
Copy link
Member Author

Trott commented Dec 11, 2016

The changes LGTM. As an alternative, what about setting a very large timeout? Do you think it makes sense?

Sure, we could use Number.MAX_SAFE_INTEGER or something like that for the timeout instead (or even in addition) if you (or anyone else) prefers. Either the move to sequential or the increase for the timeout should fix it. We could do one, the other, or both.

@santigimeno
Copy link
Member

@Trott I thought about Number.MAX_SAFE_INTEGER but it seems its value (2^53 -1) is larger than the max timeout value: 2147483647

Either the move to sequential or the increase for the timeout should fix it. We could do one, the other, or both.

I agree. I prefer the latter as moving the test to sequential will lead to a minimal increase of the running time of the tests, but any of the proposed solutions are acceptable to me.

@italoacasas italoacasas added the wip Issues and PRs that are still a work in progress. label Dec 13, 2016
test-http-client-timeout-option-listeners is flaky due to depending on
completing operations before a 100ms socket timeout. The socket timeout
is an integral part of the test but can be very large. Set to the
maximum allowable value.
@Trott Trott force-pushed the unflake-http-client-timeout branch from 359a1bf to a5e7220 Compare December 14, 2016 00:44
@Trott
Copy link
Member Author

Trott commented Dec 14, 2016

@santigimeno OK, I did it your way! PTAL!

@Trott Trott removed the wip Issues and PRs that are still a work in progress. label Dec 14, 2016
@Trott
Copy link
Member Author

Trott commented Dec 14, 2016

Trott added a commit to Trott/io.js that referenced this pull request Dec 14, 2016
test-http-client-timeout-option-listeners is flaky due to depending on
completing operations before a 100ms socket timeout. The socket timeout
is an integral part of the test but can be very large. Set to the
maximum allowable value.

PR-URL: nodejs#10224
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
@Trott
Copy link
Member Author

Trott commented Dec 14, 2016

Landed in 4a5c719.

@Trott Trott closed this Dec 14, 2016
MylesBorins pushed a commit that referenced this pull request Dec 15, 2016
test-http-client-timeout-option-listeners is flaky due to depending on
completing operations before a 100ms socket timeout. The socket timeout
is an integral part of the test but can be very large. Set to the
maximum allowable value.

PR-URL: #10224
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
@italoacasas italoacasas mentioned this pull request Dec 15, 2016
MylesBorins pushed a commit that referenced this pull request Jan 22, 2017
test-http-client-timeout-option-listeners is flaky due to depending on
completing operations before a 100ms socket timeout. The socket timeout
is an integral part of the test but can be very large. Set to the
maximum allowable value.

PR-URL: #10224
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
test-http-client-timeout-option-listeners is flaky due to depending on
completing operations before a 100ms socket timeout. The socket timeout
is an integral part of the test but can be very large. Set to the
maximum allowable value.

PR-URL: #10224
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Jan 31, 2017
test-http-client-timeout-option-listeners is flaky due to depending on
completing operations before a 100ms socket timeout. The socket timeout
is an integral part of the test but can be very large. Set to the
maximum allowable value.

PR-URL: #10224
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
@Trott Trott deleted the unflake-http-client-timeout branch January 13, 2022 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants