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

test: move test-net-connect-handle-econnrefused to sequential by lpinca · Pull Request #27014 · nodejs/node · GitHub

/ node Public

test: move test-net-connect-handle-econnrefused to sequential - #27014

Closed
lpinca wants to merge 2 commits into
nodejs:masterfrom
lpinca:gh-26907
Closed

test: move test-net-connect-handle-econnrefused to sequential#27014
lpinca wants to merge 2 commits into
nodejs:masterfrom
lpinca:gh-26907

Conversation

lpinca commented Mar 30, 2019

Copy link
Copy Markdown
Member

First commit:

test: move test-net-connect-handle-econnrefused
    
The port used in the test could be taken by another process before
the callback of `server.close()` is called. Move it to sequential.
    
Refs: https://github.com/nodejs/node/pull/18257#discussion_r162717096
Fixes: https://github.com/nodejs/node/issues/26907

Second commit:

test: refactor net-connect-handle-econnrefused
    
- Remove unneeded server
- Use `common.PORT`
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

lpinca added 2 commits March 30, 2019 15:09
The port used in the test could be taken by another process before
the callback of `server.close()` is called. Move it to sequential.

Refs: nodejs#18257 (comment)
Fixes: nodejs#26907
- Remove unneeded server
- Use `common.PORT`

Copy link
Copy Markdown
Collaborator

nodejs-github-bot added the test Issues and PRs related to the tests. label Mar 30, 2019

mscdex commented Mar 30, 2019

Copy link
Copy Markdown
Contributor

I don't see how this really changes anything? common.PORT is not any more special than a random port as far as the OS is concerned, any other process could start listening on it.

lpinca commented Mar 30, 2019
edited
Loading

Copy link
Copy Markdown
Member Author

@mscdex it is no longer run in parallel. First commit moves it to test/sequential. The assumption is that common.PORT is not taken of course. If that is not true a lot of tests in test/sequential will fails as well.

mscdex commented Mar 30, 2019

Copy link
Copy Markdown
Contributor

Instead of moving this test, why don't we just try to connect to port 0 on localhost? That should always fail with ECONNREFUSED without any potential problems.

lpinca commented Mar 30, 2019

Copy link
Copy Markdown
Member Author

Sounds good, will update in a bit.

lpinca commented Mar 30, 2019
edited
Loading

Copy link
Copy Markdown
Member Author

@mscdex it doesn't work on Windows. A different errno/code is returned.

mscdex commented Mar 30, 2019
edited
Loading

Copy link
Copy Markdown
Contributor

FWIW it looks like we could do this, but it's a little more involved for Windows. Instead of simply connecting to port 0 (which I think we could safely do for non-Windows) you can create a child process running the TCP server on a random port, suspend the process (doable via powershell), and then make connections to the server until you get ECONNREFUSED. It simulates the TCP backlog filling up and the OS rejecting new connections. I tried doing the same on Linux, but a stopped process there causes client connections to just hang and retry indefinitely it seems.

Copy link
Copy Markdown
Member

What's the status here?

lpinca commented Apr 16, 2019

Copy link
Copy Markdown
Member Author

Waiting for feedbacks/reviews. In my opinion @mscdex's latest suggestion is too complex to solve an issue with a test that has problem when run in parallel. We already have a dedicated set of tests running sequentially.

cc: @nodejs/testing

Trott added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Apr 16, 2019

Copy link
Copy Markdown
Collaborator

lpinca commented Apr 26, 2019

Copy link
Copy Markdown
Member Author

@nodejs/collaborators any more opinions/suggestions?

lpinca added a commit to lpinca/node that referenced this pull request Apr 27, 2019
The port used in the test could be taken by another process before
the callback of `server.close()` is called. Move it to sequential.

PR-URL: nodejs#27014
Fixes: nodejs#26907
Refs: nodejs#18257 (comment)
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
lpinca added a commit to lpinca/node that referenced this pull request Apr 27, 2019
- Remove unneeded server
- Use `common.PORT`

PR-URL: nodejs#27014
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>

lpinca commented Apr 27, 2019
edited
Loading

Copy link
Copy Markdown
Member Author

Landed in eca71e5...66cf4b5.

lpinca closed this Apr 27, 2019
targos pushed a commit that referenced this pull request Apr 27, 2019
The port used in the test could be taken by another process before
the callback of `server.close()` is called. Move it to sequential.

PR-URL: #27014
Fixes: #26907
Refs: #18257 (comment)
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
targos pushed a commit that referenced this pull request Apr 27, 2019
- Remove unneeded server
- Use `common.PORT`

PR-URL: #27014
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
targos mentioned this pull request Apr 27, 2019
lpinca deleted the gh-26907 branch April 27, 2019 17:43
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.

6 participants


Back | FazBrowse Home | New Git URL