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

test: refactor test-dgram-setBroadcast.js by cjihrig · Pull Request #11252 · nodejs/node · GitHub

/ node Public

test: refactor test-dgram-setBroadcast.js - #11252

Closed
cjihrig wants to merge 1 commit into
nodejs:masterfrom
cjihrig:broadcast
Closed

test: refactor test-dgram-setBroadcast.js#11252
cjihrig wants to merge 1 commit into
nodejs:masterfrom
cjihrig:broadcast

Conversation

cjihrig commented Feb 9, 2017

Copy link
Copy Markdown
Contributor

This test wasn't actually working, as sockets were being closed, allowing the test to exit before any assertions were actually run. This commit refactors the test to maintain the same intended semantics.

If anyone is curious, I found this while looking at the code coverage report.

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

This test wasn't actually working, as sockets were being closed,
allowing the test to exit before any assertions were actually
run. This commit refactors the test to maintain the same intended
semantics.
nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 9, 2017

Trott commented Feb 9, 2017

Copy link
Copy Markdown
Member

I don't think test-dgram-membership is afflicted with the same issue, but is it worth refactoring out its identical setup() anyway as a precaution or anything? (I have no opinion either way.)

Trott 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 if CI is green

mscdex added the dgram Issues and PRs related to the dgram subsystem / UDP. label Feb 9, 2017

cjihrig commented Feb 9, 2017

Copy link
Copy Markdown
Contributor Author

@Trott it looks like test-dgram-membership is fine. I'll probably update it a little bit to at least improve the error message checking with assert.throws().

The problem with this test isn't setup(). The problem here is that the test would synchronously call bind() and then teardown the socket. At least on my machine, this means that nothing was keeping the event loop open, and the code inside the bind() callback was never getting a chance to execute. This seems to be the case on the machine where code coverage was running as well.

cjihrig commented Feb 9, 2017

Copy link
Copy Markdown
Contributor Author

jasnell pushed a commit that referenced this pull request Feb 11, 2017
This test wasn't actually working, as sockets were being closed,
allowing the test to exit before any assertions were actually
run. This commit refactors the test to maintain the same intended
semantics.

PR-URL: #11252
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

jasnell commented Feb 11, 2017

Copy link
Copy Markdown
Member

Landed in fe2b5f0

jasnell closed this Feb 11, 2017
italoacasas pushed a commit that referenced this pull request Feb 13, 2017
This test wasn't actually working, as sockets were being closed,
allowing the test to exit before any assertions were actually
run. This commit refactors the test to maintain the same intended
semantics.

PR-URL: #11252
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Feb 14, 2017
This test wasn't actually working, as sockets were being closed,
allowing the test to exit before any assertions were actually
run. This commit refactors the test to maintain the same intended
semantics.

PR-URL: nodejs#11252
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
krydos pushed a commit to krydos/node that referenced this pull request Feb 25, 2017
This test wasn't actually working, as sockets were being closed,
allowing the test to exit before any assertions were actually
run. This commit refactors the test to maintain the same intended
semantics.

PR-URL: nodejs#11252
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell pushed a commit that referenced this pull request Mar 7, 2017
This test wasn't actually working, as sockets were being closed,
allowing the test to exit before any assertions were actually
run. This commit refactors the test to maintain the same intended
semantics.

PR-URL: #11252
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

jasnell commented Mar 7, 2017

Copy link
Copy Markdown
Member

would need a backport PR to land in v4

MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
This test wasn't actually working, as sockets were being closed,
allowing the test to exit before any assertions were actually
run. This commit refactors the test to maintain the same intended
semantics.

PR-URL: #11252
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins mentioned this pull request Mar 9, 2017
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

dgram Issues and PRs related to the dgram subsystem / UDP. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL