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

test: refactor test-net-connect-options-allowhalfopen.js by refack · Pull Request #13003 · nodejs/node · GitHub

/ node Public

test: refactor test-net-connect-options-allowhalfopen.js - #13003

Merged
refack merged 1 commit into
nodejs:masterfrom
refack:try-fix-test-halfopen-12951
Sep 20, 2017
Merged

test: refactor test-net-connect-options-allowhalfopen.js#13003
refack merged 1 commit into
nodejs:masterfrom
refack:try-fix-test-halfopen-12951

Conversation

refack commented May 12, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

Try to stabilize test/parallel/test-net-connect-options-allowhalfopen.js
Fixes: #12951

Test is stable but could use some loving.

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

test,net

nodejs-github-bot added the test Issues and PRs related to the tests. label May 12, 2017

refack commented May 12, 2017

Copy link
Copy Markdown
Contributor Author

refack changed the title test: to to stabilize test test: try to stabilize test May 12, 2017

refack commented May 12, 2017

Copy link
Copy Markdown
Contributor Author

Trying to fail on freeBSD: https://ci.nodejs.org/job/node-test-commit-freebsd/9006/

mscdex added the net Issues and PRs related to the net subsystem. label May 13, 2017

Copy link
Copy Markdown
Contributor

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

This should be removed.

Copy link
Copy Markdown
Contributor Author

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

Ack.
I just added it to try to check something.
That test is interacting with the test of this PR.

refack commented May 13, 2017

Copy link
Copy Markdown
Contributor Author

mscdex commented May 13, 2017

Copy link
Copy Markdown
Contributor

A stress test CI job is better for checking flakiness fixes.

refack commented May 13, 2017

Copy link
Copy Markdown
Contributor Author

I need to test the interaction of two test:
test/parallel/test-net-connect-local-error.js
and
test/parallel/test-net-connect-options-allowhalfopen.js
One is connecting to the other's server...

refack commented May 13, 2017

Copy link
Copy Markdown
Contributor Author

refack changed the title test: try to stabilize test test: refactor test-net-connect-options-allowhalfopen.js May 15, 2017
refack force-pushed the try-fix-test-halfopen-12951 branch from d09d2c0 to dfed152 Compare May 15, 2017 22:46

refack commented May 16, 2017

Copy link
Copy Markdown
Contributor Author

const host = common.localhostIPv4;

function serverOnConnection(socket) {
console.error(`'connection' ${++serverConnections} emitted on server`);

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

if the console output is not necessary for the test, please remove them :-)

Copy link
Copy Markdown
Contributor Author

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

They were very usefull for debugging. Gone now.

refack commented Jun 13, 2017

Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Member

This needs a rebase and there are a couple linter errors.

refack force-pushed the try-fix-test-halfopen-12951 branch from ce5ba90 to ec67d66 Compare September 3, 2017 22:50

refack commented Sep 3, 2017

Copy link
Copy Markdown
Contributor Author

ping @nodejs/testing

refack force-pushed the try-fix-test-halfopen-12951 branch from ec67d66 to e02d7b0 Compare September 3, 2017 22:59

refack commented Sep 3, 2017

Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Member

Ping @nodejs/testing @Trott

Trott commented Sep 19, 2017

Copy link
Copy Markdown
Member

I need to test the interaction of two test:
test/parallel/test-net-connect-local-error.js
and
test/parallel/test-net-connect-options-allowhalfopen.js
One is connecting to the other's server...

I may be missing something important here, but you can run a stress test on just those two tests with something like:

-j 4 --repeat 100 test/parallel/test-net-connect-local-error.js test/parallel/test-net-connect-options-allowhalfopen.js

Trott commented Sep 19, 2017

Copy link
Copy Markdown
Member

I have to attend to something else right now but I'll try to make a point to look at this in the next 24 hours...

Trott commented Sep 20, 2017

Copy link
Copy Markdown
Member

Any chance we can get a more detailed commit message?

Trott commented Sep 20, 2017

Copy link
Copy Markdown
Member

Change seem good to me but might be useful to get @bnoordhuis, @indutny, @nodejs/streams to take a look.

refack commented Sep 20, 2017
edited
Loading

Copy link
Copy Markdown
Contributor Author

-j 4 --repeat 100 test/parallel/test-net-connect-local-error.js test/parallel/test-net-connect-options-allowhalfopen.js

Yeah I didn't think about it at the time.
It was just hard to follow so I massaged it a little bit so it would be easier to track why it failed. Turns out this test on it's own is stable.
What happened is:

  1. test/parallel/test-net-connect-local-error.js is trying to connect to something like listen(0).port + 1 so it would fail.
  2. on openBSD ephemeral ports are given sequentially.
  3. This test runs in parallel and actually binds said port.
  4. both test fail.

I think we solved this dis-harmony by moving test-net-connect-local-error.js to sequential. So what's left in this PR if just refactoring.

AFAICT this was blocked because @jasnell asked to remove the logging, but I'm -0 on that since the order of events in the test is tricky. Eventually it was the log that made me wonder where the 7th connection is coming from if the clients are only making 6 🤔

Mismatched serverOnConnection function calls. Expected 6, actual 7.
    at forAllClients (/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1010/test/parallel/test-net-connect-options-allowhalfopen.js:44:38)
...
No. 4 connection is closing server:
  7 FIN received by server,
  6 FIN received by client,
  6 FIN sent by client,
  7 FIN sent by server
Server has been closed:
  7 FIN received by server,
  6 FIN received by client,
  6 FIN sent by client,
  7 FIN sent by server

mcollina left a comment

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

LGTM

PR-URL: nodejs#13003
Fixes: nodejs#12951
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
refack force-pushed the try-fix-test-halfopen-12951 branch from e02d7b0 to 01c680b Compare September 20, 2017 20:41
refack merged commit 01c680b into nodejs:master Sep 20, 2017

refack commented Sep 20, 2017

Copy link
Copy Markdown
Contributor Author

Quick sanity of master: https://ci.nodejs.org/job/node-test-commit-linuxone/8705/

refack deleted the try-fix-test-halfopen-12951 branch September 20, 2017 20:44
jasnell pushed a commit that referenced this pull request Sep 20, 2017
PR-URL: #13003
Fixes: #12951
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Qard pushed a commit to Qard/ayo that referenced this pull request Sep 21, 2017
PR-URL: nodejs/node#13003
Fixes: nodejs/node#12951
Reviewed-By: Matteo Collina <matteo.collina@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

net Issues and PRs related to the net subsystem. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: flaky parallel/test-net-connect-options-allowhalfopen on macOS & freeBSD

8 participants


Back | FazBrowse Home | New Git URL