0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

289 Commits

Author SHA1 Message Date
James M Snell
eeada6ca63 crypto: migrate timingSafeEqual to internal/errors
PR-URL: https://github.com/nodejs/node/pull/16448
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-26 07:47:16 -07:00
Michaël Zasso
556ebab30e child_process: restore exec{File}Sync error props
In PR [1], a bunch of properties were removed from the error thrown by
execSync and execFileSync. It turns out that some of those were still
supposed to be there, as the documentation states that the error
contains the entire result from the spawnSync call.

[1] https://github.com/nodejs/node/pull/13601

PR-URL: https://github.com/nodejs/node/pull/16060
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-23 14:09:11 +02:00
Anatoli Papirovski
a627c5fc13
net: fix timeouts during long writes
Add updateWriteQueueSize which updates and returns queue size
(net & tls). Make _onTimeout check whether an active write
is ongoing and if so, call _unrefTimer rather than emitting
a timeout event.

Add http & https test that checks whether long-lasting (but
active) writes timeout or can finish writing as expected.

PR-URL: https://github.com/nodejs/node/pull/15791
Fixes: https://github.com/nodejs/node/issues/15082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2017-10-21 09:49:02 -04:00
Rich Trott
c9d5be4af0 test: fix flaky test-make-doc
`test-make-doc` fails in CI on Raspberry Pi devices where `test-ci-js`
runs the test but does not build the docs. We do not want to build the
docs in these cases. Move the test to the `doctool` suite and add that
suite to `IGNORED_SUITES` in `test.py`. Specify `doctool` as a test
suite to run with `make test` or `make test-ci` but not with the
`make test-ci-js` job run on cross-compiled fanned CI tests like we do
with Raspberry Pi devices in CI.

PR-URL: https://github.com/nodejs/node/pull/16301
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-19 09:07:51 -07:00
jBarz
31cde1c511 test: skip test due to file size limit
The test requires a file size limit that is greater than the string
size limit. Some aix machines might not meet this criteria so in
which case we should skip the test.

PR-URL: https://github.com/nodejs/node/pull/16273
Fixes: https://github.com/nodejs/node/issues/16319
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: MichaëZasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-10-19 09:55:55 -04:00
Andreas Madsen
7c079d1261
async_hooks: skip runtime checks when disabled
PR-URL: https://github.com/nodejs/node/pull/15454
Ref: https://github.com/nodejs/node/pull/14387
Ref: https://github.com/nodejs/node/pull/14722
Ref: https://github.com/nodejs/node/issues/14717
Ref: https://github.com/nodejs/node/issues/15448
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-10-19 12:45:21 +02:00
Anna Henningsen
5cde451ffd
fs: account for buffer alloc failure in readFile
PR-URL: https://github.com/nodejs/node/pull/16219
Refs: https://github.com/nodejs/node/pull/15362
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-10-19 02:39:07 -02:00
Rich Trott
28dcdb9108 test: fix flaky test-benchmark-buffer
Allow zero operations for short buffer benchmark tests.

PR-URL: https://github.com/nodejs/node/pull/16296
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-18 12:00:04 -07:00
zhangzifa
e647c5d7de timers: fix eventloop block
When there are at least 2 timers set by setInterval whose callback
execution are longer than interval, the eventloop will be blocked.

This commit fix the above bug.

PR-URL: https://github.com/nodejs/node/pull/15072
Fixes: https://github.com/nodejs/node/issues/15068
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-18 11:59:11 -07:00
Joyee Cheung
df5dc2da39 test: test make doc and verify toc
PR-URL: https://github.com/nodejs/node/pull/16208
Fixes: https://github.com/nodejs/build/issues/887
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-10-18 20:24:22 +08:00
Rich Trott
9be3d99b2b test: fix inspector tests
The inspector tests should not be in the parallel directory as they
likely all (or certainly almost all) use static ports, so port
collisions will happen.

This moves them all to sequential. We can move them back on a
case-by-case basis. They were run sequentially when they were in the
inspector directory which they were only moved from very recently.

PR-URL: https://github.com/nodejs/node/pull/16281
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
2017-10-17 23:10:20 -07:00
Jon Moss
978629ca12
test: move inspector tests to parallel/sequential
* remove inspector directory artifacts

PR-URL: https://github.com/nodejs/node/pull/16197
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-17 19:35:50 -04:00
JamesNimlos
4e835b334b test: use fixtures module over fixturesDir
clean up code by using fixtures helper module
instead of fixturesDir directly.

PR-URL: https://github.com/nodejs/node/pull/15847
Reviewed-By: Ryan Graham <r.m.graham@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-10-15 00:04:54 +08:00
Tyler Seabrook
bb56fbbfe5 test: update fixturesDir import
Import fixturesDir path from common/fixturesDir
module rather than from common.

PR-URL: https://github.com/nodejs/node/pull/15887
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-14 22:25:50 +08:00
Chad Zezula
ce9d55d78f test: fix ordering of strictEqual actual/expected
Change all assert.strictEqual() to have actual value 1st
and expected value 2nd.

PR-URL: https://github.com/nodejs/node/pull/16008
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-13 12:28:52 -07:00
Christian Murphy
cfe14eed9f test: replaces fixturesDir with fixtures methods
PR-URL: https://github.com/nodejs/node/pull/15817
Reviewed-By: Ryan Graham <r.m.graham@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-10-13 20:26:38 +08:00
Suresh Srinivas
cd64b4166b test: use fixtures in test-process-warnings
PR-URL: https://github.com/nodejs/node/pull/15869
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-10-12 18:18:39 -07:00
Rich Trott
7e4893df60 test: reduce test-benchmark-http iterations
Supply `type=asc` option in test-benchmark-http to reduce runs in all
benchmark files to one combination of options.

PR-URL: https://github.com/nodejs/node/pull/16137
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-12 09:23:34 -07:00
Edward Andrew Robinson
7205e0a0fe test: added a test comment
Added comments to the tests to better describe what the test is doing.

PR-URL: https://github.com/nodejs/node/pull/16003
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-11 22:55:15 -07:00
Guilherme Akio Sakae
f170f8493c test: change fixturesDir to fixtures.path
PR-URL: https://github.com/nodejs/node/pull/15863
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-10-10 21:39:21 -07:00
creisle
4a1359fe1d
test: changed fixtures require
PR-URL: https://github.com/nodejs/node/pull/15899
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-10-09 02:13:19 -07:00
penDerGraft
261ae7f58a
test: replace fixturesDir with fixtures module
PR-URL: https://github.com/nodejs/node/pull/15919
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-10-09 02:13:16 -07:00
Eric Pemberton
55bb9c4128
test: improve assert messages
PR-URL: https://github.com/nodejs/node/pull/15972
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-10-08 15:05:01 -07:00
Rich Trott
a3cd8ed168 test: skip test if host is too slow
test-http-server-consumed-timeout will fail if the host is sufficiently
loaded that a 25ms interval takes more than 200ms to be invoked. Skip
the test in that situation.

PR-URL: https://github.com/nodejs/node/pull/15688
Fixes: https://github.com/nodejs/node/issues/14312
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-10-04 09:19:26 -07:00
Timothy Gu
2f8ddb2734
inspector: reimplement JS binding
- Group all relevant methods/states into a C++ class.
- Uses internal fields instead of the less efficient v8::External for
  storing the pointer to the C++ object.
- Use AsyncWrap to allow instrumenting callback states.

PR-URL: https://github.com/nodejs/node/pull/15643
Refs: https://github.com/nodejs/node/issues/13503
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-02 21:38:15 -07:00
James M Snell
1f8d527e94 path: deprecate internal _makeLong, replace
Replace the internal `path._makeLong()` with a public
`path.toLongUNCPath()` method. Add documentation.

PR-URL: https://github.com/nodejs/node/pull/14956
Ref: https://github.com/standard-things/esm/issues/66
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-10-02 11:30:19 -07:00
jlvivero
34dbc9e4e8
stream: fix disparity between buffer and the count
This changes the disparity of bufferedRequestCount and the actual buffer
on file _stream_writable.js

PR-URL: https://github.com/nodejs/node/pull/15661
Fixes: https://github.com/nodejs/node/issues/6758
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-01 23:37:15 -03:00
Rich Trott
ee90959071
test: fix test-https-writable-true-after-close
test-https-writable-true-after-close fails intermittently when run with
a lot of competing processes. Move it to sequential for stability.

PR-URL: https://github.com/nodejs/node/pull/15705
Fixes: https://github.com/nodejs/node/issues/15700
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2017-10-01 19:44:48 -03:00
James M Snell
f55ee6e24a
http2: make --expose-http2 flag a non-op
Make the `http2` module always available.
The `--expose-http2` cli flag is made a non-op

PR-URL: https://github.com/nodejs/node/pull/15535
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-28 02:01:06 -03:00
Anatoli Papirovski
de51717c3e test: fix flaky test-http2-session-timeout
Increase server timeout, reduce frequency of calls and
unbind timeout after runs are done in order to avoid
race conditions. Temporarily moved to sequential.

Fixes: https://github.com/nodejs/node/issues/15326
PR-URL: https://github.com/nodejs/node/pull/15338
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-09-18 15:19:46 +02:00
Rich Trott
082c43400d test: move test-benchmark-buffer to sequential
`test-benchmark-buffer` has been observed to timeout on CI on SmartOS.
Move the test to `sequential` so it is not competing with other tests
for resources.

PR-URL: https://github.com/nodejs/node/pull/15373
Fixes: https://github.com/nodejs/node/issues/15372
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-14 14:24:36 -07:00
Rich Trott
a172b7c51e
test: refactor test-debug-prompt
* Use cleaner `process.stdin.write('.exit')` to exit the process rather
  than `proc.kill()`.
* Move test to sequential. It uses the default port 9229. It will fail
  if another inspector test (or test using port 0) is already using that
  port. So it needs to be run sequentially rather than in parallel with
  other tests. (We haven't seen many failures with it yet because there
  aren't a lot of other inspector tests in parallel at this time.)

PR-URL: https://github.com/nodejs/node/pull/15141
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-13 17:12:57 -03:00
Anna Henningsen
5ee2d3ef0e
test: fix sequential/test-async-wrap-getasyncid
Previously, this test would contain a DNS query that timed out
after 60 seconds, thus occupying one of the parallel test slots
for that period.

Fix that by creating a new channel for that request, and cancelling
it immediately.

PR-URL: https://github.com/nodejs/node/pull/15319
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-13 17:08:58 -03:00
Jon Moss
640b20616d
test: create shared runBenchmark function
Mostly shared/duplicated logic between all benchmark test files, so
creating a new common module to store it.

PR-URL: https://github.com/nodejs/node/pull/15004
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-09-11 11:26:15 -04:00
Jon Moss
af15b755c0
test: move common.PORT tests to sequential
Reasons:

- `test-async-wrap-getasyncid` binds a handle, so move to
  sequential because port cannot be already in use.
- `test-dgram-implicit-bind-failure` requires a hardcoded
  port number to properly send socket packet.
- `test-http-agent-uninitialized-with-handle` requires a
  hardcoded port number to properly send http request.
- `test-http-agent-uninitialized` requires a hardcoded port
  number to properly send http request.
- `test-net-localport` requires a hardcoded port number
  for assertions.

In addition this replaces two common.PORTs with a dynamic port.

PR-URL: https://github.com/nodejs/node/pull/15151
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-09-10 23:56:30 -03:00
Rich Trott
d7200d6823
test: fix flaky test-readline-interface
Move test reliant on timer triggering in a timely fahion from parallel
to sequential. The test can fail under high load when the timer is
triggered too late and the `\r` and `\n` are treated as separate lines.

PR-URL: https://github.com/nodejs/node/pull/15066
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-03 17:12:56 -03:00
Miguel Angel Asencio Hurtado
9a5c3cf185
test: continue normalizing fixtures use
PR-URL: https://github.com/nodejs/node/pull/14716
Refs: https://github.com/nodejs/node/pull/14332
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
2017-08-27 21:14:34 -03:00
Rich Trott
c473d80a9c test: make timers-blocking-callback more reliable
test-timers-blocking-callback may fail erroneously on
resource-constrained machines due to the timing nature of the test.

There is likely no way around the timing issue. This change tries to
decrease the probability of the test failing erroneously by having it
retry a small number of times on failure.

Tested on 0.10.38 (which has a bug that this test was written for) and
(modifying the test slightly to remove ES6 stuff) the test still seems
to fail 100% of the time there, which is what we want/expect.

PR-URL: https://github.com/nodejs/node/pull/14831
Fixes: https://github.com/nodejs/node/issues/14792
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-20 15:41:18 -07:00
Beth Griggs
c879c9a5c6 test: preserve env in test cases
Allows env vars to be passed through to child processes. This is needed
for things like NODE_TEST_DIR or LD_LIBRARY_PATH if testing the shared
library.

PR-URL: https://github.com/nodejs/node/pull/14822
Refs: https://github.com/nodejs/node/pull/13390
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-16 17:16:27 +02:00
Rich Trott
c7a9a2edd4 test: split out load-sensitive readline tests
Two test cases in `test-readline-interface` are sensitive to resource
constraints (probably due to `\r` and `\n` not arriving within the
appropriate delay to be treated as a single line ending). Move those
tests to `sequential`.

PR-URL: https://github.com/nodejs/node/pull/14681
Fixes: https://github.com/https://github.com/nodejs/node/issues/14674
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-09 22:59:50 -07:00
James M Snell
7535a94c8a test: begin normalizing fixtures use
Adds a new `../common/fixtures' module to begin normalizing
`test/fixtures` use. Our test code is a bit inconsistent with
regards to use of the fixtures directory. Some code uses
`path.join()`, some code uses string concats, some other
code uses template strings, etc. In mnay cases, significant
duplication of code is seen when accessing fixture files, etc.

This updates many (but by no means all) of the tests in the
test suite to use the new consistent API. There are still
many more to update, which would make an excelent Code-n-Learn
exercise.

PR-URL: https://github.com/nodejs/node/pull/14332
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-08-07 18:00:57 -07:00
Rich Trott
548cc72f66 test: refactor test-domain-abort-on-uncaught
* use common.mustCall() instead of exit handler
* use execSync instead of exec so test is reliable under load
* move from sequential to parallel

PR-URL: https://github.com/nodejs/node/pull/14541
Fixes: https://github.com/nodejs/node/issues/11826
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-02 09:26:00 -07:00
Rich Trott
8c2cac650a test: refactor test/sequential/test-fs-watch.js
* add block scoping
* rename block-scoped identifiers (e.g., filenameTwo -> filename)
* use common.mustCall() instead of exit handler
* use common.mustNotCall() as appropriate
* order modules per test writing guide

PR-URL: https://github.com/nodejs/node/pull/14534
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-01 10:05:17 -07:00
Rich Trott
aa6fac68da test: adjust indentation for stricter linting
ESLint 4.x has stricter linting than previous versions. We are currently
using the legacy indentation rules in the test directory. This commit
changes the indentation of files to comply with the stricter 4.x linting
and enable stricter linting in the test directory.

PR-URL: https://github.com/nodejs/node/pull/14431
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2017-07-27 09:24:20 -07:00
笑斌
c24a73d23c test: replace concatenation with template literals
PR-URL: https://github.com/nodejs/node/pull/14293
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-07-24 21:18:59 -07:00
Ben Noordhuis
c83d9bbffb lib: include cached modules in module.children
`module.children` is supposed to be the list of modules included by this
module but lib/module.js failed to update the list when the included
module was retrieved from `Module._cache`.

Fixes: https://github.com/nodejs/node/issues/7131
PR-URL: https://github.com/nodejs/node/pull/14132
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-07-24 16:56:31 +02:00
Alexey Orlenko
239ebf0244
test: move timing-dependent tests to sequential
Move test-http-server-keep-alive-timeout-slow-server and
test-http-server-keep-alive-timeout-slow-client-headers from parallel to
sequential to resolve test flakiness on freebsd10-64.

Fixes: https://github.com/nodejs/node/issues/14033
Refs: https://github.com/nodejs/node/pull/9317
PR-URL: https://github.com/nodejs/node/pull/14377
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-07-22 07:53:27 +03:00
Sebastiaan Deckers
bb29405904
lib,src: fix consistent spacing inside braces
PR-URL: https://github.com/nodejs/node/pull/14162
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-21 15:13:47 -04:00
Vse Mozhet Byt
4f87522244 doc, lib, test: do not re-require needlessly
PR-URL: https://github.com/nodejs/node/pull/14244
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
2017-07-21 20:40:52 +03:00
章礼平
fb37922cf3 test: change isAix to isAIX
This makes the naming more consistent with existing properties like
isFreeBSD where the capitalization of the property name is consistent
with the conventional styling of the operating system.

PR-URL: https://github.com/nodejs/node/pull/14263
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
2017-07-16 02:24:47 -07:00