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: make test-http(s)-set-timeout-server alike (2) #13822

Conversation

jklepatch
Copy link
Contributor

@jklepatch jklepatch commented Jun 20, 2017

Make test-http(s)-set-timeout-server tests more similar and resolve the
following issues:

  • test-http-set-timeout-server.js was missing the check
    to if (!common.hasCrypto()).

  • test-https-set-timeout-server.js was missing some assert
    statements, including with http module

  • Both files were missing some calls to common.mustCall()

  • Both files were calling createServer() in different ways

Fixes: #13588
Refs: #13625

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

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Jun 20, 2017
@@ -21,6 +21,12 @@

'use strict';
const common = require('../common');

if (!common.hasCrypto) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well this test doesn't use crypto so this is redundant.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is unnecessary in the http test but required in the https test. It should be removed from this test.

@@ -56,83 +57,81 @@ function run() {
}

test(function serverTimeout(cb) {
const server = https.createServer(serverOptions, function(req, res) {
const server = https.createServer(serverOptions, common.mustCall(function(req, res) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think the linter is not happy with this as this line it too long. You can run make jslint to run the linter.

@aqrln aqrln added http Issues or PRs related to the http subsystem. https Issues or PRs related to the https subsystem. labels Jun 20, 2017
Trott
Trott previously requested changes Jun 20, 2017
@@ -21,6 +21,12 @@

'use strict';
const common = require('../common');

if (!common.hasCrypto) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is unnecessary in the http test but required in the https test. It should be removed from this test.

@jklepatch jklepatch force-pushed the harmonize_test_http_https_set_timeout_server_2 branch from 8db03f3 to 718b625 Compare June 20, 2017 17:49
@jklepatch
Copy link
Contributor Author

I have amended the latest commit following your comments.

@Trott Trott dismissed their stale review June 20, 2017 18:10

comment addressed, removing my request for changes

const options = {
port: server.address().port,
allowHalfOpen: true,
rejectUnauthorized: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this option doesn't make sense as this isn't a tls socket.

@lpinca
Copy link
Member

lpinca commented Jun 20, 2017

@jklepatch not a critique but can you please avoid stylistic changes next time? It will facilitate the review.
I'm talking about things like:

   server.listen(common.mustCall(function() {
-    const port = server.address().port;
-    http.get({ port: port }).on('error', common.noop);
+    http.get({
+      port: server.address().port
+    }).on('error', common.mustCall());
   }));

Make test-http(s)-set-timeout-server tests more similar and resolve the
following issues:

* `test-https-set-timeout-server.js` was missing some `assert`
   statements, including with `http` module

* Both files were missing some calls to `common.mustCall()`

* Both files were calling `createServer()` in different ways

Fixes: nodejs#13588
Refs: nodejs#13625
@jklepatch jklepatch force-pushed the harmonize_test_http_https_set_timeout_server_2 branch from 718b625 to 02f3d37 Compare June 24, 2017 11:12
@jklepatch
Copy link
Contributor Author

@lpinca got it.
I fixed the issue with the useless option in the http test.

@aqrln
Copy link
Contributor

aqrln commented Jun 25, 2017

@aqrln
Copy link
Contributor

aqrln commented Jun 26, 2017

Landed in 2e5ce2b.

I changed "Fixes" to "Refs" because there's a couple of other minor inconsistencies left. Please use full URLs to issues in your future contributions, by the way :)

Thanks!

@aqrln aqrln closed this Jun 26, 2017
aqrln pushed a commit that referenced this pull request Jun 26, 2017
Make test-http(s)-set-timeout-server tests more similar and resolve the
following issues:

* `test-https-set-timeout-server.js` was missing some `assert`
   statements, including with `http` module

* Both files were missing some calls to `common.mustCall()`

* Both files were calling `createServer()` in different ways

PR-URL: #13822
Refs: #13588
Refs: #13625
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
aqrln added a commit to aqrln/node that referenced this pull request Jun 26, 2017
* Make changes to `test-https-set-timeout-server` to resolve
  inconsistencies with its http counterpart:

  - Apply the changes analogous to those in nodejsGH-13802 to the https test.
  - Add a missing `common.mustCall()` wrapper.
  - Make small stylistic changes (e.g., remove unnecessary line breaks
    in comments) to make it visually consistent with the http test.

* Use arrow functions.

Refs: nodejs#13802
Refs: nodejs#13625
Refs: nodejs#13822
Fixes: nodejs#13588
addaleax pushed a commit that referenced this pull request Jun 29, 2017
Make test-http(s)-set-timeout-server tests more similar and resolve the
following issues:

* `test-https-set-timeout-server.js` was missing some `assert`
   statements, including with `http` module

* Both files were missing some calls to `common.mustCall()`

* Both files were calling `createServer()` in different ways

PR-URL: #13822
Refs: #13588
Refs: #13625
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@addaleax addaleax mentioned this pull request Jun 29, 2017
refack pushed a commit to refack/node that referenced this pull request Jul 3, 2017
* Make changes to `test-https-set-timeout-server` to resolve
  inconsistencies with its http counterpart:

  - Apply the changes analogous to those in nodejsGH-13802 to the https test.
  - Add a missing `common.mustCall()` wrapper.
  - Make small stylistic changes (e.g., remove unnecessary line breaks
    in comments) to make it visually consistent with the http test.

* Use arrow functions.

PR-URL: nodejs#13935
Fixes: nodejs#13588
Refs: nodejs#13802
Refs: nodejs#13625
Refs: nodejs#13822
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit to addaleax/node that referenced this pull request Jul 3, 2017
* Make changes to `test-https-set-timeout-server` to resolve
  inconsistencies with its http counterpart:

  - Apply the changes analogous to those in nodejsGH-13802 to the https test.
  - Add a missing `common.mustCall()` wrapper.
  - Make small stylistic changes (e.g., remove unnecessary line breaks
    in comments) to make it visually consistent with the http test.

* Use arrow functions.

PR-URL: nodejs#13935
Fixes: nodejs#13588
Refs: nodejs#13802
Refs: nodejs#13625
Refs: nodejs#13822
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit that referenced this pull request Jul 11, 2017
Make test-http(s)-set-timeout-server tests more similar and resolve the
following issues:

* `test-https-set-timeout-server.js` was missing some `assert`
   statements, including with `http` module

* Both files were missing some calls to `common.mustCall()`

* Both files were calling `createServer()` in different ways

PR-URL: #13822
Refs: #13588
Refs: #13625
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit that referenced this pull request Jul 11, 2017
* Make changes to `test-https-set-timeout-server` to resolve
  inconsistencies with its http counterpart:

  - Apply the changes analogous to those in GH-13802 to the https test.
  - Add a missing `common.mustCall()` wrapper.
  - Make small stylistic changes (e.g., remove unnecessary line breaks
    in comments) to make it visually consistent with the http test.

* Use arrow functions.

PR-URL: #13935
Fixes: #13588
Refs: #13802
Refs: #13625
Refs: #13822
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit that referenced this pull request Jul 18, 2017
Make test-http(s)-set-timeout-server tests more similar and resolve the
following issues:

* `test-https-set-timeout-server.js` was missing some `assert`
   statements, including with `http` module

* Both files were missing some calls to `common.mustCall()`

* Both files were calling `createServer()` in different ways

PR-URL: #13822
Refs: #13588
Refs: #13625
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit that referenced this pull request Jul 18, 2017
* Make changes to `test-https-set-timeout-server` to resolve
  inconsistencies with its http counterpart:

  - Apply the changes analogous to those in GH-13802 to the https test.
  - Add a missing `common.mustCall()` wrapper.
  - Make small stylistic changes (e.g., remove unnecessary line breaks
    in comments) to make it visually consistent with the http test.

* Use arrow functions.

PR-URL: #13935
Fixes: #13588
Refs: #13802
Refs: #13625
Refs: #13822
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Fishrock123 pushed a commit that referenced this pull request Jul 19, 2017
* Make changes to `test-https-set-timeout-server` to resolve
  inconsistencies with its http counterpart:

  - Apply the changes analogous to those in GH-13802 to the https test.
  - Add a missing `common.mustCall()` wrapper.
  - Make small stylistic changes (e.g., remove unnecessary line breaks
    in comments) to make it visually consistent with the http test.

* Use arrow functions.

PR-URL: #13935
Fixes: #13588
Refs: #13802
Refs: #13625
Refs: #13822
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Aug 14, 2017
Make test-http(s)-set-timeout-server tests more similar and resolve the
following issues:

* `test-https-set-timeout-server.js` was missing some `assert`
   statements, including with `http` module

* Both files were missing some calls to `common.mustCall()`

* Both files were calling `createServer()` in different ways

PR-URL: #13822
Refs: #13588
Refs: #13625
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Aug 15, 2017
* Make changes to `test-https-set-timeout-server` to resolve
  inconsistencies with its http counterpart:

  - Apply the changes analogous to those in GH-13802 to the https test.
  - Add a missing `common.mustCall()` wrapper.
  - Make small stylistic changes (e.g., remove unnecessary line breaks
    in comments) to make it visually consistent with the http test.

* Use arrow functions.

PR-URL: #13935
Fixes: #13588
Refs: #13802
Refs: #13625
Refs: #13822
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Aug 15, 2017
Make test-http(s)-set-timeout-server tests more similar and resolve the
following issues:

* `test-https-set-timeout-server.js` was missing some `assert`
   statements, including with `http` module

* Both files were missing some calls to `common.mustCall()`

* Both files were calling `createServer()` in different ways

PR-URL: #13822
Refs: #13588
Refs: #13625
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Aug 15, 2017
* Make changes to `test-https-set-timeout-server` to resolve
  inconsistencies with its http counterpart:

  - Apply the changes analogous to those in GH-13802 to the https test.
  - Add a missing `common.mustCall()` wrapper.
  - Make small stylistic changes (e.g., remove unnecessary line breaks
    in comments) to make it visually consistent with the http test.

* Use arrow functions.

PR-URL: #13935
Fixes: #13588
Refs: #13802
Refs: #13625
Refs: #13822
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Aug 16, 2017
Make test-http(s)-set-timeout-server tests more similar and resolve the
following issues:

* `test-https-set-timeout-server.js` was missing some `assert`
   statements, including with `http` module

* Both files were missing some calls to `common.mustCall()`

* Both files were calling `createServer()` in different ways

PR-URL: #13822
Refs: #13588
Refs: #13625
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Aug 16, 2017
* Make changes to `test-https-set-timeout-server` to resolve
  inconsistencies with its http counterpart:

  - Apply the changes analogous to those in GH-13802 to the https test.
  - Add a missing `common.mustCall()` wrapper.
  - Make small stylistic changes (e.g., remove unnecessary line breaks
    in comments) to make it visually consistent with the http test.

* Use arrow functions.

PR-URL: #13935
Fixes: #13588
Refs: #13802
Refs: #13625
Refs: #13822
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Aug 16, 2017
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. https Issues or PRs related to the https subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: test-http(s)-set-timeout-server.js tests should be more similar
7 participants