3349 Commits
Author SHA1 Message Date
Anna Henningsen f45ef442bb test: refactor test-http-default-port
- Remove redundant `hasCrypto` checks
- Use `common.mustCall()`
- Use arrow functions
- Deduplicate HTTP & HTTPS code

PR-URL: https://github.com/nodejs/node/pull/17562
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-12-12 03:28:42 -05:00
Eugene Ostroukhov 54cd7dfd88 inspector: Fix crash for WS connection
Attaching WS session will now include a roundtrip onto the main thread
to make sure there is no other session (e.g. JS bindings)

This change also required refactoring WS socket implementation to better
support scenarios like this.

Fixes: https://github.com/nodejs/node/issues/16852
PR-URL: https://github.com/nodejs/node/pull/17085
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-12-12 03:28:41 -05:00
Anatoli Papirovski aa32bd08a8 tools: prefer common.expectsError in tests
Add lint rule to validate that common.expectsError(fn, err) is being
used instead of assert.throws(fn, common.expectsError(err));

PR-URL: https://github.com/nodejs/node/pull/17557
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-12-12 03:28:40 -05:00
Anatoli Papirovski 49d662846e test: replace assert.throws w/ common.expectsError
PR-URL: https://github.com/nodejs/node/pull/17557
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-12-12 03:28:40 -05:00
Mithun Sasidharan f7e5ab082d test: refactored to remove unnecessary variables
PR-URL: https://github.com/nodejs/node/pull/17553
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-12 03:28:39 -05:00
Federico Kauffman bb780d2d84 test: use Countdown in http-agent test
PR-URL: https://github.com/nodejs/node/pull/17537
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-12-12 03:28:37 -05:00
Collins Abitekaniza 510116ebe6 test: update http test to use common.mustCall
PR-URL: https://github.com/nodejs/node/pull/17528
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-12-12 03:28:36 -05:00
Adri Van Houdt 39d8e4413a test: improve assert messages in repl-reset-event
PR-URL: https://github.com/nodejs/node/pull/16836
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-12-12 03:28:34 -05:00
Gus Caplan 8383c348b8 util: fix negative 0 check in inspect
PR-URL: https://github.com/nodejs/node/pull/17507
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-12-12 03:28:34 -05:00
TomerOmri 6576382eaa test: update test-http-should-keep-alive to use countdown
PR-URL: https://github.com/nodejs/node/pull/17505
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2017-12-12 03:28:34 -05:00
Rich Trott f3d619882e test: fix flaky test-benchmark-es
Allow zero iterations for short benchmark in test.

PR-URL: https://github.com/nodejs/node/pull/17516
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-12-12 03:28:32 -05:00
Mithun Sasidharan ff59d3a30e test: replace assert.throws w/ common.expectsError
PR-URL: https://github.com/nodejs/node/pull/17483
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-12-12 03:28:31 -05:00
Mithun Sasidharan 28b2d8ac20 test: use common.expectsError in tests
PR-URL: https://github.com/nodejs/node/pull/17484
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2017-12-12 03:28:30 -05:00
Mithun Sasidharan d15cdc6fdb test: replace assert.throws w/ common.expectsError
PR-URL: https://github.com/nodejs/node/pull/17498
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2017-12-12 03:28:30 -05:00
idandagan1 993b1cbc6d test: use Countdown in http test
PR-URL: https://github.com/nodejs/node/pull/17506
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-12 03:28:30 -05:00
Mithun Sasidharan 1aae28b7c9 test: use Number.isNaN instead of global isNaN
PR-URL: https://github.com/nodejs/node/pull/17515
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-12 03:28:28 -05:00
Mandeep Singh 2a5da9c2c9 test: use Countdown in http-response-statuscode
PR-URL: https://github.com/nodejs/node/pull/17327
Refs: https://github.com/nodejs/node/issues/17169
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-12-12 03:28:27 -05:00
Shilo Mangam 919625bd6a test: use Countdown in test-http-set-cookies
PR-URL: https://github.com/nodejs/node/pull/17504
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2017-12-12 03:28:27 -05:00
Mithun Sasidharan f399667784 test: replace assert.throws w/ common.expectsError
PR-URL: https://github.com/nodejs/node/pull/17497
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-12 03:28:26 -05:00
Mithun Sasidharan c2ff36ed7f test: replace assert.throws w/ common.expectsError
PR-URL: https://github.com/nodejs/node/pull/17494
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-12 03:28:26 -05:00
sreepurnajasti af8e27d10e test: Use common.mustCall in http test
PR-URL: https://github.com/nodejs/node/pull/17487
Refs: https://github.com/nodejs/node/issues/17169
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-12-12 03:28:25 -05:00
Francisco Gerardo Neri Andriano 7b8622f946 test: update http test to use Countdown
PR-URL: https://github.com/nodejs/node/pull/17477
Refs: https://github.com/nodejs/node/issues/17169
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2017-12-12 03:28:25 -05:00
Leko fb553b5b59 test: improve crypto test coverage
- Call Sign without new
- Call Verify without new
- Call Verify#verify with options.padding !== options.padding >> 0
- Call Verify#verify with options.saltLength !== options.saltLength >> 0

PR-URL: https://github.com/nodejs/node/pull/17426
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-12 03:28:23 -05:00
Leko 928aecc92c test: replace fs.accessSync with fs.existsSync
PR-URL: https://github.com/nodejs/node/pull/17446
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-12-12 03:28:23 -05:00
Rich Trott 7d3a84388d test: fix flaky test-benchmark-querystring
Allow zero iterations for short benchmark in test.

PR-URL: https://github.com/nodejs/node/pull/17517
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-12-12 03:28:22 -05:00
Rich Trott 50f120eaac test: fix flaky test-benchmark-util
Allow for zero iterations on benchmarks with a short duration.

PR-URL: https://github.com/nodejs/node/pull/17473
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
2017-12-12 03:28:20 -05:00
Rich Trott 6c97f7fed5 doc: use American spellings per style guide
PR-URL: https://github.com/nodejs/node/pull/17471
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-12 03:28:19 -05:00
Leko a407a48bdf test: expand coverage for crypto
crypto.Hash
- Call constructor without new keyword

crypto.Hmac
- Call constructor without new keyword
- Call constructor with typeof hmac != string
- Call constructor with typeof hmac = string, typeof key != string

PR-URL: https://github.com/nodejs/node/pull/17447
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-12-12 03:28:19 -05:00
Mithun Sasidharan 8c32b4a37a test: refactor code to use common.mustCall
PR-URL: https://github.com/nodejs/node/pull/17437
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-12-12 03:28:17 -05:00
Rich Trott cca3526faf test: add more settings to test-benchmark-dgram
Add settings to test-benchmark-dgram such that it only runs benchmark
per benchmark file.

PR-URL: https://github.com/nodejs/node/pull/17462
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-12-12 03:28:14 -05:00
jopann 562007ce2a test: add dgram benchmark test
PR-URL: https://github.com/nodejs/node/pull/17462
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-12-12 03:28:13 -05:00
XadillaX 026f76024b dns: fix crash while setting server during query
Fix this issue follow these two points:

1. Keep track of how many queries are currently open. If `setServers()`
   is called while there are open queries, error out.
2. For `Resolver` instances, use option 1. For dns.setServers(), just
   create a fresh new default channel every time it is called, and then
   set its servers list.

PR-URL: https://github.com/nodejs/node/pull/14891
Fixes: https://github.com/nodejs/node/issues/14734
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-12-12 03:28:13 -05:00
Rich Trott 619cbc4364 test: fix flaky test-benchmark-events
Make sure each benchmark file only runs one combination of options.
Allow for zero iterations for short benchmark.

PR-URL: https://github.com/nodejs/node/pull/17472
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-12-12 03:28:13 -05:00
Mithun Sasidharan d8018bc91d test: update test-http-request-dont-override-options to use common.mustCall
PR-URL: https://github.com/nodejs/node/pull/17438
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-12 03:28:12 -05:00
Mithun Sasidharan 07fd4cfbe0 test: use common.mustCall in test-http-malformed-request
PR-URL: https://github.com/nodejs/node/pull/17439
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-12-12 03:28:11 -05:00
Mithun Sasidharan 85e6271995 test: use Countdown in http test
PR-URL: https://github.com/nodejs/node/pull/17436
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-12 03:28:11 -05:00
Rich Trott 8c81ba0b1c test: remove common.PORT from parallel tests
`common.PORT` should not be used in parallel tests because another test
may experience a collision with `common.PORT` when using port 0 to get
an open port. This has been observed to result in test failures in CI.

PR-URL: https://github.com/nodejs/node/pull/17410
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Lance Ball <lball@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-12-12 03:28:10 -05:00
hmammedzadeh 5fecdbaca9 test: update test-http-response-multiheaders to use countdown
PR-URL: https://github.com/nodejs/node/pull/17419
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2017-12-12 03:28:10 -05:00
Mithun Sasidharan 69e775d454 test: update test-http-timeout to use countdown
PR-URL: https://github.com/nodejs/node/pull/17341
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-12-12 03:28:10 -05:00
Lance Ball 9cbb0dadc0 test: make common.mustNotCall show file:linenumber
When a test fails via `common.mustNotCall` it is sometimes hard to
determine exactly what was called. This modification stores the
caller's file and line number by using the V8 Error API to capture
a stack at the time `common.mustNotCall()` is called. In the event
of failure, this information is printed.

This change also exposes a new function in test/common, `getCallSite()`
which accepts a `function` and returns a `String` with the file name and
line number for the function.

PR-URL: https://github.com/nodejs/node/pull/17257
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
2017-12-12 03:28:09 -05:00
Rich Trott 92b29cd659 test: remove common.fixturesDir from tests
Use common/fixtures module instead of common.fixturesDir.

PR-URL: https://github.com/nodejs/node/pull/17400
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Lance Ball <lball@redhat.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-12-12 03:28:08 -05:00
Benjamin Zaslavsky 23967b2713 console: make dirxml an alias for console.log
This method was previously exposed by V8 (since node 8.0.0) but not
implemented in node.

PR-URL: https://github.com/nodejs/node/pull/17152
Refs: https://github.com/nodejs/node/issues/17128
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-12-12 03:28:08 -05:00
Leko 0afcea280e test: add test case for missing branch
- The case of id is string, flags is number
- The case of flags is not 0

PR-URL: https://github.com/nodejs/node/pull/17418
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2017-12-12 03:28:07 -05:00
Mithun Sasidharan c9a4f4f8f1 test: update test-http-upgrade-client to use countdown
PR-URL: https://github.com/nodejs/node/pull/17339
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-12-12 03:28:07 -05:00
Mithun Sasidharan 91d541627e test: update test-http-status-reason-invalid-chars to use countdown
PR-URL: https://github.com/nodejs/node/pull/17342
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-12-12 03:28:07 -05:00
Mithun Sasidharan 4fb070873e test: refactored test-http-allow-req-after-204-res to countdown
PR-URL: https://github.com/nodejs/node/pull/17211
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-12-12 03:28:04 -05:00
ChungNgoops ef25de7493 test: update test/parallel/test-http-pipe-fs.js to use countdown
PR-URL: https://github.com/nodejs/node/pull/17346
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-12-12 03:28:04 -05:00
Mithun Sasidharan 1866b05042 test: refactored test-http-response-splitting to use countdown
PR-URL: https://github.com/nodejs/node/pull/17348
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-12-12 03:28:04 -05:00
NiveditN ee1c95f992 test: expanded assertions for console.timeEnd() output
Added assertions to verify that console.time() coerces labels to
strings correctly, by comparing against the expected output values of
console.timeEnd().

This helps resolve https://github.com/nodejs/node/issues/14544 but will
not address the whole thing.

PR-URL: https://github.com/nodejs/node/pull/17368
Refs: https://github.com/nodejs/node/pull/14643
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-12-12 03:28:03 -05:00
Leko 8336e4f88e test: add test case for process.dlopen with undefined
PR-URL: https://github.com/nodejs/node/pull/17343
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2017-12-12 03:28:02 -05:00