test: clean up net server try ports test #8458

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
8 participants
@tlhunter
Contributor

tlhunter commented Sep 9, 2016

Checklist
  • make -j4 test (UNIX)
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change
  • Replace var's with const and let
  • Replace boolean flags with common.mustCall()
  • Using stricter comparisons
  • Fixed typo in comment
@MylesBorins

This comment has been minimized.

Show comment
Hide comment
@MylesBorins

MylesBorins Sep 9, 2016

Member

LGTM if green

Member

MylesBorins commented Sep 9, 2016

LGTM if green

@mscdex

View changes

test/parallel/test-net-server-try-ports.js
socket.destroy();
});
-var server2errors = 0;
+let server2errors = 0;
+
server2.on('error', function(e) {
server2errors++;

This comment has been minimized.

@mscdex

mscdex Sep 9, 2016

Contributor

Why not get rid of this variable too and wrap the 'error' event handler in a common.mustCall() instead? That will ensure it gets called exactly once.

@mscdex

mscdex Sep 9, 2016

Contributor

Why not get rid of this variable too and wrap the 'error' event handler in a common.mustCall() instead? That will ensure it gets called exactly once.

@mscdex

View changes

test/parallel/test-net-server-try-ports.js
-var server2eaddrinuse = false;
-
-var server1 = net.Server(function(socket) {
+const server1 = net.Server(function(socket) {
socket.destroy();

This comment has been minimized.

@mscdex

mscdex Sep 9, 2016

Contributor

Instead of calling socket.destroy() we should just throw an error of some kind since this should never be reached. Or maybe we can at least just remove the function altogether and just have const server1 = net.Server();

@mscdex

mscdex Sep 9, 2016

Contributor

Instead of calling socket.destroy() we should just throw an error of some kind since this should never be reached. Or maybe we can at least just remove the function altogether and just have const server1 = net.Server();

@mscdex

View changes

test/parallel/test-net-server-try-ports.js
socket.destroy();
});
-var server2 = net.Server(function(socket) {
+const server2 = net.Server(function(socket) {
socket.destroy();

This comment has been minimized.

@mscdex

mscdex Sep 9, 2016

Contributor

Ditto.

@mscdex

mscdex Sep 9, 2016

Contributor

Ditto.

@tlhunter

This comment has been minimized.

Show comment
Hide comment
@tlhunter

tlhunter Sep 9, 2016

Contributor

@mscdex thanks for the advice

Contributor

tlhunter commented Sep 9, 2016

@mscdex thanks for the advice

@lpinca

This comment has been minimized.

Show comment
Hide comment
@lpinca

lpinca Sep 9, 2016

Member

LGTM

Member

lpinca commented Sep 9, 2016

LGTM

@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex Sep 9, 2016

Contributor
Contributor

mscdex commented Sep 9, 2016

@tlhunter

This comment has been minimized.

Show comment
Hide comment
@tlhunter

tlhunter Sep 9, 2016

Contributor

Looks like an unrelated failure ^

not ok 1208 sequential/test-crypto-timing-safe-equal
# 
# assert.js:85
#   throw new assert.AssertionError({
#   ^
# AssertionError: timingSafeEqual should not leak information from its execution time (t=8.734740624863479)
#     at Object.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux/nodes/debian8-x86/test/sequential/test-crypto-timing-safe-equal.js:153:1)
#     at Module._compile (module.js:560:32)
#     at Object.Module._extensions..js (module.js:569:10)
#     at Module.load (module.js:477:32)
#     at tryModuleLoad (module.js:436:12)
#     at Function.Module._load (module.js:428:3)
#     at Module.runMain (module.js:594:10)
#     at run (bootstrap_node.js:382:7)
#     at startup (bootstrap_node.js:137:9)
#     at bootstrap_node.js:497:3
  ---
Contributor

tlhunter commented Sep 9, 2016

Looks like an unrelated failure ^

not ok 1208 sequential/test-crypto-timing-safe-equal
# 
# assert.js:85
#   throw new assert.AssertionError({
#   ^
# AssertionError: timingSafeEqual should not leak information from its execution time (t=8.734740624863479)
#     at Object.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux/nodes/debian8-x86/test/sequential/test-crypto-timing-safe-equal.js:153:1)
#     at Module._compile (module.js:560:32)
#     at Object.Module._extensions..js (module.js:569:10)
#     at Module.load (module.js:477:32)
#     at tryModuleLoad (module.js:436:12)
#     at Function.Module._load (module.js:428:3)
#     at Module.runMain (module.js:594:10)
#     at run (bootstrap_node.js:382:7)
#     at startup (bootstrap_node.js:137:9)
#     at bootstrap_node.js:497:3
  ---
@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex Sep 9, 2016

Contributor

@tlhunter Yeah that can be ignored for this PR

Contributor

mscdex commented Sep 9, 2016

@tlhunter Yeah that can be ignored for this PR

@santigimeno

View changes

test/parallel/test-net-server-try-ports.js
-server1.listen(0, function() {
+server1.listen(0, common.mustCall(function() {
console.error('server1 listening');

This comment has been minimized.

@santigimeno

santigimeno Sep 9, 2016

Member

I think removing both console.error could be a good idea.

@santigimeno

santigimeno Sep 9, 2016

Member

I think removing both console.error could be a good idea.

@santigimeno

This comment has been minimized.

Show comment
Hide comment
@santigimeno

santigimeno Sep 9, 2016

Member

LGTM with one suggestion

Member

santigimeno commented Sep 9, 2016

LGTM with one suggestion

test: clean up net server try ports test
* Replace var's with const and let
* Replace boolean flags with common.mustCall()
* Using stricter comparisons
* Fixed typo in comment
@tlhunter

This comment has been minimized.

Show comment
Hide comment
@tlhunter

tlhunter Sep 9, 2016

Contributor

@santigimeno console.error calls have been removed

Contributor

tlhunter commented Sep 9, 2016

@santigimeno console.error calls have been removed

@santigimeno

This comment has been minimized.

Show comment
Hide comment
@santigimeno

santigimeno Sep 9, 2016

Member

LGTM. Thanks!

Member

santigimeno commented Sep 9, 2016

LGTM. Thanks!

@Trott

This comment has been minimized.

Show comment
Hide comment
@Trott

Trott Sep 9, 2016

Member

One last CI because you never know: https://ci.nodejs.org/job/node-test-pull-request/3993/

Member

Trott commented Sep 9, 2016

One last CI because you never know: https://ci.nodejs.org/job/node-test-pull-request/3993/

@Trott

This comment has been minimized.

Show comment
Hide comment
@Trott

Trott Sep 10, 2016

Member

CI errors are unrelated. CI looks good.

Member

Trott commented Sep 10, 2016

CI errors are unrelated. CI looks good.

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Sep 12, 2016

Member

LGTM

Member

jasnell commented Sep 12, 2016

LGTM

@Trott

This comment has been minimized.

Show comment
Hide comment
@Trott

Trott Sep 12, 2016

Member

Landed in 2d7fa3d. 🎉

Member

Trott commented Sep 12, 2016

Landed in 2d7fa3d. 🎉

@Trott Trott closed this Sep 12, 2016

Trott added a commit that referenced this pull request Sep 12, 2016

test: clean up net server try ports test
* Replace var's with const and let
* Replace boolean flags with common.mustCall()
* Using stricter comparisons
* Fixed typo in comment

PR-URL: #8458
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

@tlhunter tlhunter deleted the tlhunter:test-net-server-try-ports-cleanup branch Sep 12, 2016

Fishrock123 added a commit that referenced this pull request Sep 14, 2016

test: clean up net server try ports test
* Replace var's with const and let
* Replace boolean flags with common.mustCall()
* Using stricter comparisons
* Fixed typo in comment

PR-URL: #8458
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

MylesBorins added a commit that referenced this pull request Sep 30, 2016

test: clean up net server try ports test
* Replace var's with const and let
* Replace boolean flags with common.mustCall()
* Using stricter comparisons
* Fixed typo in comment

PR-URL: #8458
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

MylesBorins added a commit that referenced this pull request Oct 10, 2016

test: clean up net server try ports test
* Replace var's with const and let
* Replace boolean flags with common.mustCall()
* Using stricter comparisons
* Fixed typo in comment

PR-URL: #8458
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

rvagg added a commit that referenced this pull request Oct 18, 2016

test: clean up net server try ports test
* Replace var's with const and let
* Replace boolean flags with common.mustCall()
* Using stricter comparisons
* Fixed typo in comment

PR-URL: #8458
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

MylesBorins added a commit that referenced this pull request Oct 26, 2016

test: clean up net server try ports test
* Replace var's with const and let
* Replace boolean flags with common.mustCall()
* Using stricter comparisons
* Fixed typo in comment

PR-URL: #8458
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

@MylesBorins MylesBorins referenced this pull request Oct 26, 2016

Closed

V4.6.2 proposal #9298

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment