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

186 Commits

Author SHA1 Message Date
Jeremiah Senkpiel
7598ed6cc0 test: parallelize test-repl-persistent-history
Refs: https://github.com/nodejs/node/pull/2224#issuecomment-127356413
PR-URL: https://github.com/nodejs/node/pull/4247
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-12-14 13:42:46 -05:00
Tristian Flanagan
dfee4e3712 module: fix column offsets in errors
Because Node modules are wrapped, errors on the first line
of a file leak the wrapper to the user and report the wrong
column number. This commit adds a line break to the module
wrapper so that the first line is treated the same as all
other lines. To compensate for the additional line, a line
offset of -1 is also applied to errors.

Fixes: https://github.com/nodejs/node/issues/2860
PR-URL: https://github.com/nodejs/node/pull/2867
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-20 16:26:24 -05:00
Minwoo Jung
d01eb6882f lib: add 'pid' prefix in internal/util
This PR improves `prefix` in `util` that we've agreed on
https://github.com/nodejs/node/pull/3833
(separate code for javascript to move the printing function
to C++ directly)

PR-URL: https://github.com/nodejs/node/pull/3878
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-20 09:24:53 -08:00
Stefan Budeanu
e499ea849c test: skip/replace weak crypto tests in FIPS mode
FIPS 140-2 does not permit the use of MD5 and RC4, skip or tests
that use them, or substitute with stronger crypto where applicable.

PR-URL: https://github.com/nodejs/node/pull/3757
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: James Snell <jasnell@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
2015-11-19 16:31:11 -05:00
Wyatt Preul
007cfea308 util: remove pump
Remove util.pump and associated tests

PR-URL: https://github.com/nodejs/node/pull/2531
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-18 14:28:35 -08:00
Rich Trott
3fea3cb627 test: run pipeline flood test in parallel
PR-URL: https://github.com/nodejs/node/pull/3811
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-13 20:45:08 -08:00
Rich Trott
d9734b7cc9 test: refactor test-http-pipeline-flood
This extends fixes for test-https-pipeline-flood to hopefully fully
eliminate its flakiness on Windows in our continuous integration
process.

PR-URL: https://github.com/nodejs/node/pull/3636
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-13 05:16:21 -08:00
Devin Nakamura
974767ec0d test: fix flaky test test-http-pipeline-flood
PR-URL: https://github.com/nodejs/node/pull/3636
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-13 05:16:01 -08:00
Sakthipriyan Vairamani
a28b938895 test: enhance fs-watch-recursive test
This patch

  - issues a TAP plugin parsable message on non darwin/windows boxes
  - uses `const` wherever applicable
  - moves the test to parallel

PR-URL: https://github.com/nodejs/node/pull/2599
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-10 08:07:41 -08:00
Evan Lucas
a4a0efc534 repl: don't crash if cannot open history file
Previously, if we are unable to open the history file, an error would
be thrown. Now, print an error message that we could not open
the history file, but don't fail.

Fixes: https://github.com/nodejs/node/issues/3610
PR-URL: https://github.com/nodejs/node/pull/3630
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-03 09:52:35 -06:00
Rich Trott
6d6bc5d9d8 test: mark http-pipeline-flood flaky
test-http-pipeline-flood has been flaky on Windows for some time.
Hopefully, https://github.com/nodejs/node/pull/2862 fixes it and
lands soon, but until then, let's mark it as flaky.

PR-URL: https://github.com/nodejs/node/pull/3616
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-11-02 13:58:05 -08:00
Rich Trott
26e47efbca test: split independent tests into separate files
Move ENOENT related tests out of general fs.watch() test file and into
its own file. This may help diagnose
https://github.com/nodejs/node/issues/3541.

PR-URL: https://github.com/nodejs/node/pull/3548
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-10-28 12:24:13 -07:00
Sakthipriyan Vairamani
aaf9b488e2 lib,test: update let to const where applicable
As per the `prefer-const` eslint rule, few instances of `let` have been
identified to be better with `const`. This patch updates all those
instances.

Refer: https://github.com/nodejs/node/issues/3118
PR-URL: https://github.com/nodejs/node/pull/3152
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-10-27 23:03:33 +05:30
Myles Borins
28e9a022df test: wrap assert.fail when passed to callback
Currently there are many instances where assert.fail is directly passed
to a callback for error handling. Unfortunately this will swallow the
error as it is the third argument of assert.fail that sets the message
not the first.

This commit adds a new function to test/common.js that simply wraps
assert.fail and calls it with the provided message.

Tip of the hat to @trott for pointing me in the direction of this.

PR-URL: https://github.com/nodejs/node/pull/3453
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-10-24 14:42:41 -07:00
Rich Trott
d89bc7bc97 test: fix flaky test-child-process-emfile
Require the test setup to obtain an EMFILE error and not ENFILE as
ENFILE means there is a race condition with other processes that may
close files before `spawn()` is called by the test.

Fixes: https://github.com/nodejs/node/issues/2666
PR-URL: https://github.com/nodejs/node/pull/3430
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-10-20 15:41:37 -07:00
Jeremiah Senkpiel
5923dee07e test: repl-persistent-history is no longer flaky
The race conditions were fixed in
286ef1daca

PR-URL: https://github.com/nodejs/node/pull/3437
Reviewed By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-10-20 10:44:06 -04:00
Wyatt Preul
8b4adb267b util: Remove p, has been deprecated for years
Update deprecation test to use another method.

Ref: https://github.com/nodejs/node/pull/2529
PR-URL: https://github.com/nodejs/node/pull/3432
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-10-19 20:52:56 +02:00
Jeremiah Senkpiel
73b7e052c0 repl: limit persistent history correctly on load
Previously the wrong end of the history was limited on load.

PR-URL: https://github.com/nodejs/node/pull/2356
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed By: Evan Lucas <evanlucas@me.com>
2015-10-19 11:53:54 -04:00
Jeremiah Senkpiel
286ef1daca test: cleanup, improve repl-persistent-history
- Now cleans up the history file unless told otherwise.
- Now also logs which test case failed.
- Waits for flush after repl close if necessary.

Fixes: https://github.com/nodejs/node/issues/2319
PR-URL: https://github.com/nodejs/node/pull/2356
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed By: Evan Lucas <evanlucas@me.com>
2015-10-19 11:53:54 -04:00
Michaël Zasso
bbdbef9274 test: fix tests after V8 upgrade
Some error messages have changed and the --debugger flag does
not exist in V8 anymore.

PR-URL: https://github.com/nodejs/node/pull/3351
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2015-10-14 11:20:35 -07:00
Myles Borins
6c032a8333 test: replace util with backtick strings
Now that we have backticks we no longer need to use util.format
to template strings!

This commit was inspired by #3324, and it replaces instances of
util.format with backtick strings in a number of tests

Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3359
2015-10-14 10:02:47 -07:00
Rich Trott
e3d9d25083 test: add test-child-process-emfile fail message
When the test fails (as it does frequently on FreeBSD unfortunately)
provide a non-cryptic error message that also provides a line number.

PR-URL: https://github.com/nodejs/node/pull/3335
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-10-13 18:27:47 -07:00
Rich Trott
72c8a74b55 test: remove common.inspect()
common.inspect() is just util.inspect(). common copies every property
from util but this is the only one that gets used and it only gets used
in three places. Well, four, but the fourth is removed in a pending PR.

This commit removes it. Subsequently, the "copy util to common"
part of `common` can be removed altogether.

PR-URL: https://github.com/nodejs/node/pull/3257
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2015-10-08 22:35:24 -07:00
Rich Trott
a1040f2065 test: refresh temp directory when using pipe
common.PIPE resides in the temp directory (except on Windows). Insure
that the temp directory is refreshed in tests that use common.PIPE.

PR-URL: https://github.com/nodejs/node/pull/3231
Fixes: https://github.com/nodejs/node/issues/3227
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-10-08 20:05:22 -07:00
Junliang Yan
a9d42e0131 test: fix losing original env vars issue
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: https://github.com/nodejs/node/pull/3190
2015-10-08 07:51:46 -07:00
Rich Trott
099cfbc58c test: remove deprecated error logging
common.error() is just deprecated util.error() renamed.
Remove calls to it and some other extraneous console logging
in tests.

PR-URL: https://github.com/nodejs/node/pull/3079
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-10-07 11:13:38 -07:00
Sakthipriyan Vairamani
6ad458b752 module: remove unnecessary property and method
`require.paths` property and `require.registerExtension` function have
been throwing errors when used. They both are like this for years now.
This patch removes them from the system.

PR-URL: https://github.com/nodejs/node/pull/2922
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-10-06 18:56:20 +05:30
charlierudolph
87e820ead5 fs: include filename in watch errors
This commit adds the relevant filename to fs.watch() errors.

Refs: https://github.com/nodejs/node-v0.x-archive/pull/25542
PR-URL: https://github.com/nodejs/node/pull/2748
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-10-02 10:04:02 -04:00
Rich Trott
02fe8215f0 test: load common.js to test for global leaks
common.js contains code that checks for variables leaking into the
global namespace. Load common.js in all tests that do not
intentionally leak variables.

PR-URL: https://github.com/nodejs/node/pull/3095
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-10-01 20:16:35 -07:00
Rich Trott
306936e98f test: change calls to deprecated util.print()
common.print() is just util.print() and as such prints a deprecation
warning. Per docs, update to console.log().

PR-URL: https://github.com/nodejs/node/pull/3083
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-09-28 13:21:15 -07:00
Rich Trott
44efd66132 test: replace deprecated util.debug() calls
common.debug() is just util.debug() and emits a deprecation notice. Per
docs, use console.error() instead.

PR-URL: https://github.com/nodejs/node/pull/3082
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-09-28 11:15:06 -07:00
Sakthipriyan Vairamani
571a517259 test: test sync version of mkdir & rmdir
This patch includes tests for sync versions of mkdir and rmdir.
Also, it moves the test to `parallel`.

PR-URL: https://github.com/nodejs/node/pull/2588
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-09-21 12:42:45 +05:30
Sakthipriyan Vairamani
61d48b45b5 test: use tmpDir instead of fixtures in readdir
This patch

 - makes the test use tmp directory instead of the fixtures directory,
 - simplifies the code
 - moves the test to `parallel`.

PR-URL: https://github.com/nodejs/node/pull/2587

Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-09-20 16:18:07 +05:30
Sakthipriyan Vairamani
9aa6a437cd test: use tmp directory in chdir test
This patch

 - makes chdir test to use the tmp directory
 - moves the test to parallel
 - renames the file to test-process-chdir as chdir is in process module

PR-URL: https://github.com/nodejs/node/pull/2589
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-09-17 04:49:47 +05:30
Sakthipriyan Vairamani
f0a75ab2d3 doc,test: enable recursive file watching in Windows
Recursive file watching is supported by libuv since 1.7.0. Refer
https://github.com/nodejs/node/blob/master/deps/uv/ChangeLog#L126. This
patch notes that in the docs and enables testing this feature. It also
adds proper TAP plugin parsable message for other platforms.

PR-URL: https://github.com/nodejs/node/pull/2649
Fixes: https://github.com/nodejs/node/issues/375
Reviewed-By: rvagg - Rod Vagg <rod@vagg.org>
Reviewed-By: silverwind - Roman Reiss <me@silverwind.io>
2015-09-06 21:38:07 +10:00
Karl Skomski
6ed0603fb1 build: add --enable-asan with builtin leakcheck
PR-URL: https://github.com/nodejs/node/pull/2376
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-09-06 21:38:00 +10:00
Rich Trott
10a32aee84 test: refactor to eliminate flaky test
This retains the key elements of test-child-process-fork-getconnections
(forks a child process, sends a bunch of sockets, uses getConnections()
to enumerate them) but contains some code to work around an apparent
intermittent bug that occurs on OS X where a socket seems to close
itself unexpectedly.

https://github.com/nodejs/node/issues/2610 was opened for the bug that
was causing the problem in the first place.

PR-URL: https://github.com/nodejs/node/pull/2609
Fixes: https://github.com/nodejs/node/issues/1100
Reviewed-By: jbergstroem - Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-09-06 21:37:59 +10:00
João Reis
68a658d82b test: mark test-vm-syntax-error-stderr as flaky
Ref: https://github.com/nodejs/node/issues/2660

PR-URL: https://github.com/nodejs/node/pull/2662
Reviewed-By: orangemocha - Alexis Campailla <orangemocha@nodejs.org>
2015-09-02 17:40:01 -04:00
João Reis
242c88b8ae test: mark test-repl-persistent-history as flaky
This test is already being investigated, but until a solution is found
it should be marked flaky.

Ref: https://github.com/nodejs/node/issues/2319
Ref: https://github.com/nodejs/node/pull/2356

PR-URL: https://github.com/nodejs/node/pull/2659
Reviewed-By: orangemocha - Alexis Campailla <orangemocha@nodejs.org>
2015-09-02 13:28:27 -04:00
Sakthipriyan Vairamani
b11e256574 test: use tmpDir instead of fixturesDir
This test was using fixturesDir to create temp files to test. This
patch replaces that with tmpDir and uses `assert` module to test.
Also, this test has been moved to `parallel`, from `sequential` mode.

PR-URL: https://github.com/nodejs/node/pull/2583
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-08-28 04:18:03 +05:30
Ben Noordhuis
de88255b0f Revert "lib,src: add unix socket getsockname/getpeername"
This reverts commit 6cd0e2664b.
This reverts commit 7a999a1376.
This reverts commit f337595441.

It turns out that on Windows, uv_pipe_getsockname() is a no-op for
client sockets.  It slipped through testing because of a CI snafu.

PR-URL: https://github.com/nodejs/node/pull/2584
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-08-28 00:14:13 +02:00
Ben Noordhuis
f337595441 lib,src: add unix socket getsockname/getpeername
The implementation is a minor API change in that socket.address() now
returns a `{ address: '/path/to/socket' }` object, like it does for TCP
and UDP sockets.  Before this commit, it returned `socket._pipeName`,
which is a string when present.

Change common.PIPE on Windows from '\\\\.\\pipe\\libuv-test' to
'\\\\?\\pipe\\libuv-test'.  Windows converts the '.' to a '?' when
creating a named pipe, meaning that common.PIPE didn't match the
result from NtQueryInformationFile().

Fixes: https://github.com/nodejs/node/issues/954
PR-URL: https://github.com/nodejs/node/pull/956
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-08-27 17:45:04 +02:00
Alexis Campailla
34e25b2313 test: initial list of flaky tests
This poplulates the lists of flaky tests with tests that failed recently
in Jenkins.

PR-URL: https://github.com/nodejs/node/pull/2424
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-08-27 05:49:55 +02:00
Alexis Campailla
ff05953b8d test: add test configuration templates
Template configuration files for marking tests as flaky.

PR-URL: https://github.com/nodejs/node/pull/2424
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-08-27 05:49:28 +02:00
Todd Kennedy
3849750a09 repl: dont throw ENOENT on NODE_REPL_HISTORY_FILE
If you have no history file written to disk, but the environment
variable set, `fs.readFileSync` will throw an ENOENT error,
but there's nothing to convert. The converter should ignore
ENOENT on that `fs.readFileSync` call.

Fixes: https://github.com/nodejs/node/issues/2449
PR-URL: https://github.com/nodejs/node/pull/2451
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-08-20 10:29:35 -04:00
muddletoes
6fff0f73dc test: correct spelling of 'childProcess'
Per: https://github.com/joyent/node/pull/8715

Cleans up a minor spelling error in two tests.

PR-URL: https://github.com/nodejs/node/pull/2389
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-08-17 20:55:19 +02:00
Jeremiah Senkpiel
ceee8d2807 test: add tests for persistent repl history
PR-URL: https://github.com/nodejs/io.js/pull/2224
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-08-04 11:56:18 -07:00
Fedor Indutny
ef65321083 node: do not override message/stack of error
Put the `...^` arrow string to the hidden property of the object, and
use it only when printing error to the stderr.

Fix: https://github.com/nodejs/io.js/issues/2104
PR-URL: https://github.com/nodejs/io.js/pull/2108
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-08-04 11:56:16 -07:00
Sakthipriyan Vairamani
80a1cf7425 test: fix messages and use return to skip tests
This is a followup of https://github.com/nodejs/io.js/pull/2109.
The tests which didn't make it in #2109, are included in this patch.
The skip messages are supposed to follow the format

    1..0 # Skipped: [Actual reason why the test is skipped]

and the tests should be skipped with the return statement.

PR-URL: https://github.com/nodejs/io.js/pull/2290
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-08-03 21:32:48 +05:30
Sakthipriyan Vairamani
d5ab92bcc1 test: use common.isWindows consistently
In the tests, we use "process.platform === 'win32'" in some places.
This patch replaces them with the "common.isWindows" for consistency.

PR-URL: https://github.com/nodejs/io.js/pull/2269
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-07-31 00:29:36 +05:30
Sakthipriyan Vairamani
4e78cd71c0 test: skip IPv6 part before testing it
PR-URL: https://github.com/nodejs/io.js/pull/2226
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-07-27 23:24:03 +05:30
Sakthipriyan Vairamani
79c865a53f test: changing process.exit to return while skipping tests
This patch uses `return` statement to skip the test instead of using
`process.exit` call.

PR-URL: https://github.com/nodejs/io.js/pull/2109
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-07-20 15:50:42 +05:30
Sakthipriyan Vairamani
69298d36cf test: formatting skip messages for TAP parsing
This patch makes the skip messages consistent so that the TAP plugin
in CI can parse the messages properly. The format will be

    1..0 # Skipped: [Actual reason why the test is skipped]

PR-URL: https://github.com/nodejs/io.js/pull/2109
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-07-20 15:46:30 +05:30
Roman Reiss
d4ceb16da2 test: properly clean up temp directory
A persistent failure on OS X 10.11 uncovered a inproperly cleaned up
temp directory in this test. This changes the mkdirSync call to clean up
properly in case it throws.

PR-URL: https://github.com/nodejs/io.js/pull/2164
Reviewed-By: Evan Lucas <evanlucas@me.com>
2015-07-12 01:09:25 +02:00
Sakthipriyan Vairamani
9cd44bb2b6 util: prepend '(node) ' to deprecation messages
Changes included in this commit are

   1. Making the deprecation messages consistent. The messages will be in
      the following format

           x is deprecated. Use y instead.

      If there is no alternative for `x`, then the ` Use y instead.` part
      will not be there in the message.

   2. All the internal deprecation messages are printed with the prefix
      `(node) `, except when the `--trace-deprecation` flag is set.

Fixes: https://github.com/nodejs/io.js/issues/1883
PR-URL: https://github.com/nodejs/io.js/pull/1892
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-07-03 16:32:29 +02:00
Roman Reiss
e3f9335c40 tools: re-enable comma-spacing linter rule
The rule was disabled because of an eslint bug which is now resolved.
All code in lib was already conforming and only test code needed a few
changes to make the linter happy with this rule enabled.

Ref: https://github.com/eslint/eslint/issues/2408

PR-URL: https://github.com/nodejs/io.js/pull/2072
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
Reviewed-by: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Alex Kocharin <alex@kocharin.ru>
2015-06-29 19:04:16 +02:00
Roman Reiss
fb8811d95e lib,test: fix whitespace issues
PR-URL: https://github.com/nodejs/io.js/pull/1971
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-06-15 16:37:37 +02:00
Rich Trott
7c79490bfb test: only refresh tmpDir for tests that need it
Expose `common.refreshTmpDir()` and only call it
for tests that use common.tmpDir or common.PIPE.

A positive side effect is the removal of a code
smell where child processes were detected by the
presence of `.send()`. Now each process can decide
for itself if it needs to refresh tmpDir.

PR-URL: https://github.com/nodejs/io.js/pull/1954
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-06-13 22:27:17 -07:00
Rich Trott
a6b8ee19b8 test: create temp dir in common.js
Move creation of temporary directories for tests
out of the Python harness and into common.js. This
allows all tests to be run reliably outside of the
Python wrapper.

PR-URL: https://github.com/nodejs/io.js/pull/1877
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-06-12 10:27:29 +10:00
Rod Vagg
f78c722df5 test: remove hardwired references to 'iojs'
PR-URL: https://github.com/nodejs/io.js/pull/1882
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-06-03 16:53:05 +02:00
Evan Lucas
5b6f575c1f Revert "src: add getopt option parser"
This reverts commit c0e7bf2d8c.

There are a few edge cases that can cause a crash
and need to be properly handled.

PR-URL: https://github.com/nodejs/io.js/pull/1862
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-06-01 11:25:32 -05:00
Evan Lucas
c0e7bf2d8c src: add getopt option parser
Options have been moved into the NodeOptions class.
A new global, node_options now exists and is used
to access the options after the command line arguments
have been parsed.

PR-URL: https://github.com/nodejs/io.js/pull/1804
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-06-01 08:39:06 -05:00
Roman Reiss
f29762f4dd test: enable linting for tests
Enable linting for the test directory. A number of changes was made so
all tests conform the current rules used by lib and src directories. The
only exception for tests is that unreachable (dead) code is allowed.

test-fs-non-number-arguments-throw had to be excluded from the changes
because of a weird issue on Windows CI.

PR-URL: https://github.com/nodejs/io.js/pull/1721
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-05-19 21:21:27 +02:00
Rod Vagg
f9b226c1c1 test: extend timeouts for ARMv6
Based on tests running on original Raspberry Pi

PR-URL: https://github.com/iojs/io.js/pull/1554
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-04-29 19:28:11 +10:00
Roman Reiss
7049d7b474 test: increase timeouts on ARM
This commit introduces platform-specific test timeouts for the ARM
architectures. ARMv6 is notoriously slow so gets very large timeouts on
both the timeout value for each test, as well as certain problematic
individual tests. ARMv7 and ARMv8 also get slightly increased headroom.

PR-URL: https://github.com/iojs/io.js/pull/1366
Fixes: https://github.com/iojs/io.js/issues/1343
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-04-09 15:10:34 +02:00
Roman Reiss
955c1508da test: reduce sequential/test-fs-watch flakiness
The fs.watch test's write events sometimes aren't produced on OS X,
possibly because of a fsevents race condition. This patch gives delays
the writing a total of 20ms, which makes the test pass consistently.

PR-URL: https://github.com/iojs/io.js/pull/1275
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-27 17:08:07 +01:00
Ben Noordhuis
9705a34e96 test: move sequential/test-signal-unregister
Move sequential/test-signal-unregister to test/parallel, it doesn't
need to run in sequential mode.

PR-URL: https://github.com/iojs/io.js/pull/1227
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-03-23 00:56:16 +01:00
Ben Noordhuis
10a9c00563 test: fix timing issue in signal test
Change sequential/test-signal-unregister so it doesn't use fixed
timeouts for sending the signal and expecting the child to quit.

Fixes: https://github.com/iojs/io.js/issues/1223
PR-URL: https://github.com/iojs/io.js/pull/1227
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-03-23 00:55:34 +01:00
Rod Vagg
f600111d82 test: cache lazy properties, fix style nits
inFreeBSDJail involves an execSync() and is used by localhost_ipv4 so
will be unnecessarily expensive, so cache both values and reuse
rather than re-evaluate each time.

Renamed localhost_ipv4 to localhostIPv4 for style consistency.

PR-URL: https://github.com/iojs/io.js/pull/1196
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-03-19 16:27:45 +11:00
Johan Bergström
c15e81afdd test: Introduce knowledge of FreeBSD jails
FreeBSD jails act differently than your average vm or similar
application container. All routing passes through one ip address,
which makes things like localhost or 0.0.0.0 resolve differently.

Introduce a helper that allows us to verify if we're in a jail
and another one for returning an ip address for localhost.

Also, skip one test instead of trading additional complexity
in common.js for one specific user scenario.

PR-URL: https://github.com/iojs/io.js/pull/1167
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-19 09:11:50 +11:00
Shigeki Ohtsu
82f067e60b test: fix ext commands to be double quoted
Paths used on the Windows command line need to be enclosed in double
quotes, or they'll be parsed incorrectly when there are spaces in the
path.

PR-URL: https://github.com/iojs/io.js/pull/1122
Reviewed-by: Bert Belder <bertbelder@gmail.com>
2015-03-12 17:35:20 -07:00
Johan Bergström
671fbd5a9d test: refactor all tests that depends on crypto
we had a few ways versions of looking for support before executing a test. this
commit unifies them as well as add the check for all tests that previously
lacked them. found by running `./configure --without-ssl && make test`. also,
produce tap skip output if the test is skipped.

PR-URL: https://github.com/iojs/io.js/pull/1049
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
2015-03-05 10:31:41 +09:00
Brendan Ashworth
0df54303c1 test: common.js -> common
This commit changes many test styles to change all references
from require('./common.js'); to require('./common');.

The latter is much more common, with the former only being used in 50
tests. It is just a stylistic change, and it seems that `common.js` was
introduced by a rogue test and copied and pasted into the rest.

Semver: patch
PR-URL: https://github.com/iojs/io.js/pull/917
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-22 19:34:17 -08:00
Glen Keane
5e825d1073 tracing: add lttng support for tracing on linux
This commit adds the ability to enable userspace tracing with lttng
in io.js. It adds tracepoints for all the equivalent dtrace and ETW
tracepoints. To use these tracepoints enable --with-lttng on linux.

PR-URL: https://github.com/iojs/io.js/pull/702
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ryan Graham <ryan@strongloop.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2015-02-09 18:06:57 +01:00
Vladimir Kurchatkin
8de89ec465 lib: move default address logic to net._listen2
When address is not provided to `server.listen()`, `_connectionKey` and
error messages should include actual address and correct family.

PR-URL: https://github.com/iojs/io.js/pull/539
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-23 18:09:39 +01:00
Ben Noordhuis
1ea607cb29 test: move sequential/test-debug-port-from-cmdline
Move sequential/test-debug-port-from-cmdline to test/parallel.  Per the
previous commit, it should now be possible to run the test in parallel
with other debugger tests.

PR-URL: https://github.com/iojs/io.js/pull/501
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-01-19 19:30:04 +01:00
Julien Gilli
2f33e00d71 test: fix test-debug-port-from-cmdline.js
Make this test less prone to race conditions by using synchronous
interprocess communication instead of a timer to determine when the
child process is ready to receive messages from its parent.

Also, remove a superfluous timer since the tests suite already makes
tests time out after a while.

Original-PR-URL: https://github.com/joyent/node/pull/9049
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>

PR-URL: https://github.com/iojs/io.js/pull/501
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-01-19 19:29:18 +01:00
Fedor Indutny
27e9ed6e98 test: fix setproctitle on FreeBSD
PR-URL: https://github.com/iojs/io.js/pull/332
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-13 20:36:44 +03:00
isaacs
3e1b1dd4a9 Remove excessive copyright/license boilerplate
The copyright and license notice is already in the LICENSE file.  There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
2015-01-12 15:30:28 -08:00
Ben Noordhuis
c8676cb361 test: move sequential/test-debug-port-cluster
Move sequential/test-debug-port-cluster to test/parallel.  This test
is safe to run in parallel with other debugger tests, it doesn't use
fixed port numbers.

PR-URL: https://github.com/iojs/io.js/pull/306
Reviewed-By: Miroslav Bajtoš <miroslav@strongloop.com>
2015-01-12 18:31:34 +01:00
Ben Noordhuis
3da4f87b32 test: move sequential/test-debug-signal-cluster
Move sequential/test-debug-signal-cluster to test/parallel.  Per the
previous commit, it can now run in parallel with other debugger tests.

PR-URL: https://github.com/iojs/io.js/pull/306
Reviewed-By: Miroslav Bajtoš <miroslav@strongloop.com>
2015-01-12 18:31:31 +01:00
Ben Noordhuis
11c1bae734 lib: make --debug-port work with cluster
Make the cluster module intercept the `--debug-port=<port>` command line
switch and replace it with the debug port of the child process.

A happy coincidence of this change is that it finally makes it possible
to run the sequential/test-debug-signal-cluster in parallel, it now no
longer needs the default port numbers.

PR-URL: https://github.com/iojs/io.js/pull/306
Reviewed-By: Miroslav Bajtoš <miroslav@strongloop.com>
2015-01-12 18:31:29 +01:00
Ben Noordhuis
5ec5fd83d4 test: delete sequential/test-debug-cluster
The test does not work well with concurrent invocations of the test
runner because it uses fixed port numbers.  The functionality it tests
is covered by sequential/test-debug-port-cluster, a verbatim copy with
the only difference being that it doesn't use fixed port numbers.

PR-URL: https://github.com/iojs/io.js/pull/306
Reviewed-By: Miroslav Bajtoš <miroslav@strongloop.com>
2015-01-12 18:30:54 +01:00
Caitlin Potter
be2404e0d3 core: throw TypeError if chdir() args are wrong
PR-URL: https://github.com/iojs/io.js/pull/274
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-09 18:36:15 +01:00
cjihrig
5678595856 fs: deprecate exists() and existsSync()
These methods don't follow standard conventions, and shouldn't
be used anyway.

Fixes: https://github.com/iojs/io.js/issues/103
PR-URL: https://github.com/iojs/io.js/pull/166
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-19 10:27:48 -05:00
Fedor Indutny
0e19476595 test: split test in parallel/sequential
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/iojs/io.js/pull/172
Fix: iojs/io.js#139
2014-12-17 20:45:02 +07:00