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

Harmonize test http https set timeout server #13625

Conversation

jklepatch
Copy link
Contributor

@jklepatch jklepatch commented Jun 12, 2017

Fixes #13588

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows [commit guidelines]
Affected core subsystem(s)

test/sequential and test/parallel

[refack fixed formating]

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Jun 12, 2017
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

LGTM if CI is green

@Trott
Copy link
Member

Trott commented Jun 12, 2017

@nodejs/testing

@mscdex mscdex added http Issues or PRs related to the http subsystem. https Issues or PRs related to the https subsystem. labels Jun 12, 2017
@mscdex
Copy link
Contributor

mscdex commented Jun 12, 2017

If you want, there are some other minor differences that could be made consistent, for example:

  • server.listen(<callback>) vs server.listen(0, <callback>)
  • missing assert.ok(s instanceof http.OutgoingMessage);-type asserts in the https test file
  • missing common.mustCall()s in the https test file (e.g. around server.listen() callback -- compared to http test file) and the http test file (e.g. around request handler callback -- compared to https test file)
  • etc..

Really the only differences that should exist between the two should be the references to the http module vs the https module, use of net.connect() vs tls.connect(), and https.Server-specific stuff, like the passing of the cert, etc. configuration to https.createServer(). Everything else should be the same.

@jklepatch
Copy link
Contributor Author

ok, Ill do that. May I know which test should be taken as the reference to be copied from? http or https?

@mscdex
Copy link
Contributor

mscdex commented Jun 12, 2017

@jklepatch That's kind of the problem, it depends. For the server.listen() example I would just omit the port number I think.

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

LGTM with or without the other requested changes, although they should probably be addressed at some point.

const s = req.setTimeout(50, function() {
caughtTimeout = true;
req.socket.destroy();
const s = req.setTimeout(50, common.mustCall(function(socket) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: one of the spaces after the comma is superfluous.

@aqrln
Copy link
Contributor

aqrln commented Jun 16, 2017

@jklepatch ping. Are you still up to working on this? This PR is a clear improvement over the existing tests as is, so if you currently don't have time to implement the other suggestions, you or someone else may do that in another PR.

CI: https://ci.nodejs.org/job/node-test-pull-request/8688/

@jklepatch
Copy link
Contributor Author

@aqrln I am still up for doing the remaining changes discussed. Should I continue to work on this PR or open another one?

@Trott
Copy link
Member

Trott commented Jun 17, 2017

@aqrln I am still up for doing the remaining changes discussed. Should I continue to work on this PR or open another one?

I personally prefer multiple small PRs over one omnibus PR. If a bug slips through, we can revert just the problematic part and not everything.

@jklepatch
Copy link
Contributor Author

ok. I'll start another PR for the rest of the work now. Nothing to add to this PR then.

@aqrln
Copy link
Contributor

aqrln commented Jun 18, 2017

@aqrln
Copy link
Contributor

aqrln commented Jun 19, 2017

Landed in bed3579. Thanks for the contribution!

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

* `test-http-set-timeout-server.js` had a `secReceived` check in
  `serverResponseTimeoutWithPipeline()` that was added to prevent
  flakiness, but this did not exist in the https counterpart.

* `test-https-set-timeout-server.js` utilized `common.mustCall()`,
  `common.mustNotCall()`, etc., while the http counterpart utilized the
  old method of checking flags on exit of the process.

Refs: #13588
PR-URL: #13625
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
addaleax pushed a commit that referenced this pull request Jun 20, 2017
Make test-http(s)-set-timeout-server tests more similar and resolve the
following issues:

* `test-http-set-timeout-server.js` had a `secReceived` check in
  `serverResponseTimeoutWithPipeline()` that was added to prevent
  flakiness, but this did not exist in the https counterpart.

* `test-https-set-timeout-server.js` utilized `common.mustCall()`,
  `common.mustNotCall()`, etc., while the http counterpart utilized the
  old method of checking flags on exit of the process.

Refs: #13588
PR-URL: #13625
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
@addaleax addaleax mentioned this pull request Jun 21, 2017
addaleax pushed a commit that referenced this pull request Jun 21, 2017
Make test-http(s)-set-timeout-server tests more similar and resolve the
following issues:

* `test-http-set-timeout-server.js` had a `secReceived` check in
  `serverResponseTimeoutWithPipeline()` that was added to prevent
  flakiness, but this did not exist in the https counterpart.

* `test-https-set-timeout-server.js` utilized `common.mustCall()`,
  `common.mustNotCall()`, etc., while the http counterpart utilized the
  old method of checking flags on exit of the process.

Refs: #13588
PR-URL: #13625
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
@addaleax addaleax mentioned this pull request Jun 21, 2017
jklepatch added a commit to jklepatch/node that referenced this pull request Jun 24, 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

Fixes: nodejs#13588
Refs: nodejs#13625
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>
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-http-set-timeout-server.js` had a `secReceived` check in
  `serverResponseTimeoutWithPipeline()` that was added to prevent
  flakiness, but this did not exist in the https counterpart.

* `test-https-set-timeout-server.js` utilized `common.mustCall()`,
  `common.mustNotCall()`, etc., while the http counterpart utilized the
  old method of checking flags on exit of the process.

Refs: #13588
PR-URL: #13625
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@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-http-set-timeout-server.js` had a `secReceived` check in
  `serverResponseTimeoutWithPipeline()` that was added to prevent
  flakiness, but this did not exist in the https counterpart.

* `test-https-set-timeout-server.js` utilized `common.mustCall()`,
  `common.mustNotCall()`, etc., while the http counterpart utilized the
  old method of checking flags on exit of the process.

Refs: #13588
PR-URL: #13625
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@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-http-set-timeout-server.js` had a `secReceived` check in
  `serverResponseTimeoutWithPipeline()` that was added to prevent
  flakiness, but this did not exist in the https counterpart.

* `test-https-set-timeout-server.js` utilized `common.mustCall()`,
  `common.mustNotCall()`, etc., while the http counterpart utilized the
  old method of checking flags on exit of the process.

Refs: #13588
PR-URL: #13625
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@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