summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* dns: add resolvePtr to query plain DNS PTR recordsDaniel Turing2016-02-083-1/+33
| | | | | | | | | | Resolving plain PTR records is used beyond reverse DNS, most prominently with DNS-SD (RFC6763). This adds dns.resolvePtr(), and uses it (instead of dns.reverse()) in dns.resolve(). PR-URL: https://github.com/nodejs/node/pull/4921 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Brian White <mscdex@mscdex.net>
* dns: add failure test for dns.resolveXXXDaniel Turing2016-02-081-0/+89
| | | | | | | | | test whether the various resolve functions cause ENOTFOUND when trying to resolve a known invalid domain/hostname. PR-URL: https://github.com/nodejs/node/pull/4921 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Brian White <mscdex@mscdex.net>
* test: fix flaky test-dgram-pingpongRich Trott2016-02-072-65/+21
| | | | | | | | | | | | | | There is no guarantee UDP messages will be received. Accommodate the occasional dropped message. This is a functionality test, not a performance benchmark. Speed up the test by not sending 1500 messages across three ports. Fixes: https://github.com/nodejs/node/issues/4526 PR-URL: https://github.com/nodejs/node/pull/5125 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
* buffer: remove deprecated Buffer.write branchdcposch@dcpos.ch2016-02-071-3/+3
| | | | | | | | | | | * Explit throw on deprecated Buffer.write(...) * Update tests, remove obsolete Buffer.write(...) * Add comment for obsolete Buffer.write(...) PR-URL: https://github.com/nodejs/node/pull/5048 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: mark flaky tests on Raspberry PiRich Trott2016-02-062-1/+4
| | | | | | | | | | | | A few tests have started failing on Raspberry Pi devices in CI. https://ci.nodejs.org/job/node-test-binary-arm/943/ PR-URL: https://github.com/nodejs/node/pull/5082 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com> Ref: https://github.com/nodejs/node/issues/4830 Ref: https://github.com/nodejs/node/issues/3635 Ref: https://github.com/nodejs/node/issues/4526
* node_contextify: do not incept debug contextMyles Borins2016-02-052-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | Currently a debug context is created for various calls to util. If the node debugger is being run the main context is the debug context. In this case node_contextify was freeing the debug context and causing everything to explode. This change moves around the logic and no longer frees the context. There is a concern about the dangling pointer The regression test was adapted from code submitted by @3y3 in #4815 Fixes: https://github.com/nodejs/node/issues/4440 Fixes: https://github.com/nodejs/node/issues/4815 Fixes: https://github.com/nodejs/node/issues/4597 Fixes: https://github.com/nodejs/node/issues/4952 PR-URL: https://github.com/nodejs/node/issues/4815 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>
* querystring: check that maxKeys is finiteMyles Borins2016-02-051-0/+55
| | | | | | | | | | | | | | | | There was a very subtle change in behavior introduced with 27def4f In the past if querystring.parse was given Infinity for maxKeys, everything worked as expected. Check to see is maxKeys is Infinity before forwarding the value to String.prototype.split which causes this regression PR-URL: https://github.com/nodejs/node/pull/5066 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
* buffer: remove duplicated code in fromObjectHUANG Wei2016-02-041-0/+7
| | | | | | | | | | Add fromArrayLike() to handle logic of copying in values from array-like argument. PR-URL: https://github.com/nodejs/node/pull/4948 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* tools: lint for spacing around unary operatorsRich Trott2016-02-0415-17/+17
| | | | | | | | | | | | | | Enable `space-unary-ops` in `.eslintrc`. This prohibits things like: i ++ // use `i++` instead typeof(foo) // use `typeof foo` or `typeof (foo)` instead Ref: https://github.com/nodejs/node/pull/4772#discussion_r51732299 PR-URL: https://github.com/nodejs/node/pull/5063 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: fix `net-socket-timeout-unref` flakinessSantiago Gimeno2016-02-041-6/+17
| | | | | | | | | | | | | From time to time this test is failing in OS X because at least one of the connections takes quite a long time (around 5 seconds) causing some of the timers may fire before the test exited. To solve this, wait for all the connections to be established before setting the timeouts and unrefing the sockets. PR-URL: https://github.com/nodejs/node/pull/4772 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* tls: add getProtocol() to TLS socketsBrian White2016-02-031-0/+43
| | | | | | | | | | This commit adds a new method for TLS sockets that returns the negotiated protocol version. PR-URL: https://github.com/nodejs/node/pull/4995 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: fix redeclared test-event-emitter-* varsRich Trott2016-02-022-5/+4
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/4985 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
* test: fix redeclared test-intl varRich Trott2016-02-021-2/+2
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/4988 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
* test: remove redeclared var in test-domainRich Trott2016-02-021-1/+1
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/4984 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
* test: fix variable redeclarationsRich Trott2016-02-029-32/+31
| | | | | | | | | | I'm a fan of small changesets, but even I'm getting a little annoyed at me for opening all these PRs weeding out variable redeclarations. So I'm bundling a bunch of small changes here. PR-URL: https://github.com/nodejs/node/pull/4992 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: fix redeclared test-util-* varsRich Trott2016-02-021-101/+119
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/4994 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
* test: fix redeclared vars in sequential testsRich Trott2016-02-023-5/+5
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/4999 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
* test: fix tls-no-rsa-key flakinessSantiago Gimeno2016-02-021-2/+9
| | | | | | | | | | | In some conditions it can happen that the client-side socket is destroyed before the server-side socket has gracefully closed, thus causing a 'ECONNRESET' error in this socket. To solve this, wait in the client-side socket for the 'end' event before closing it. PR-URL: https://github.com/nodejs/node/pull/4043 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* test: fix redeclared vars in test-urlRich Trott2016-02-021-13/+13
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/4993 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* test: fix redeclared test-path varsRich Trott2016-02-021-6/+8
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/4991 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: fix var redeclarations in test-osRich Trott2016-02-021-15/+19
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/4990 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com>
* https: evict cached sessions on errorFedor Indutny2016-02-011-0/+88
| | | | | | | | | | | Instead of using the same session over and over, evict it when the socket emits error. This could be used as a mitigation of #3692, until OpenSSL fix will be merged/released. See: https://github.com/nodejs/node/issues/3692 PR-URL: https://github.com/nodejs/node/pull/4982 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
* test: fix test-net-* variable redeclarationsRich Trott2016-02-011-3/+3
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/4989 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
* test: fix redeclared test-http-* varsRich Trott2016-02-013-21/+11
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/4987 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
* test: fix var redeclarations in test-fs-*Rich Trott2016-02-012-2/+1
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/4986 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
* test: fix redeclared vars in test-vm-*Rich Trott2016-02-014-6/+6
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/4997 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* dns: coerce port to number in lookupServiceEvan Lucas2016-02-011-2/+18
| | | | | | | | | | | | | Previously, port could be any number in dns.lookupService. This change throws a TypeError if port is outside the range of 0-65535. It also coerces the port to a number. PR-URL: https://github.com/nodejs/node/pull/4883 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: fix inconsistent styling in test-urlBrian White2016-02-011-749/+749
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/5014 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: pummel test fixesRich Trott2016-02-013-7/+8
| | | | | | | | | | This fixes some variable redeclarations in pummel tests and, in the process, gets `test-stream-pipe-multi.js` to run again. It had been failing to run. PR-URL: https://github.com/nodejs/node/pull/4998 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: remove var redeclarations in test-crypto-*Rich Trott2016-02-015-90/+97
| | | | | | PR-URL: https://github.com/nodejs/node/pull/4981 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: remove test-cluster-* var redeclarationsRich Trott2016-02-013-6/+5
| | | | | | PR-URL: https://github.com/nodejs/node/pull/4980 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: fix test-http-extra-response flakinessSantiago Gimeno2016-02-011-0/+4
| | | | | | | | | | It can happen that the extra response is to be sent in a different chunk from the rest of the data. At this moment, the client might have already closed the socket causing an `ECONNRESET` error. PR-URL: https://github.com/nodejs/node/pull/4979 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: Add assertion for TLS peer certificate fingerprintAlan Cohen2016-02-011-0/+2
| | | | | | PR-URL: https://github.com/nodejs/node/pull/4923 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: scope redeclared vars in test-child-process*Rich Trott2016-01-316-32/+37
| | | | | | | | A handful of child process tests had variables declared multiple times in the same scope using `var`. This change scopes those declarations. PR-URL: https://github.com/nodejs/node/pull/4944 Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
* test: add common.platformTimeout() to dgram testRich Trott2016-01-311-9/+6
| | | | | | | | | | | Use common.platformTimeout() to mitigate potential for CI to timeout on slower devices. Ref: https://github.com/nodejs/node/issues/4937 PR-URL: https://github.com/nodejs/node/pull/4938 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <mborins@us.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* test: fix flaky cluster test on Windows 10Rich Trott2016-01-311-10/+3
| | | | | | | | | test-cluster-shared-leak was flaky on Windows 10. Remove unnecessary .send() calls and replace with .disconnect() to avoid spurious EPIPE. Fixes: https://github.com/nodejs/node/issues/4887 PR-URL: https://github.com/nodejs/node/pull/4934 Reviewed-By: James M Snell <jasnell@gmail.com>
* buffer: validate list elements in Buffer.concatMichaël Zasso2016-01-311-4/+14
| | | | | | | | | | | | | Without this change, if any of the elements in the list to be concatenated is not a Buffer instance, the method fails with "buf.copy is not a function". Make an isBuffer check before using the copy method so that we can throw with a better message. Fixes: https://github.com/nodejs/node/issues/4949 PR-URL: https://github.com/nodejs/node/pull/4951 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
* net: move isLegalPort to internal/netEvan Lucas2016-01-301-0/+15
| | | | | | | | | | | | isLegalPort can be used in more places than just net.js. This change moves it to a new internal net module in preparation for using it in the dns module. PR-URL: https://github.com/nodejs/node/pull/4882 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
* contextify: use offset/length from Uint8ArrayFedor Indutny2016-01-291-19/+47
| | | | | | | | | | | | | Do not blindly take data from underlying `ArrayBuffer`, use `ByteOffset`/`ByteLength` of `Uint8Array` itself. Additionally, fix tests that weren't actually properly running because of V8's internal code cache. The code should be different, otherwise the cached data won't be used at all. Fix: #4939 PR-URL: https://github.com/nodejs/node/pull/4947 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* dgram: support dgram.send with multiple buffersMatteo Collina2016-01-294-24/+64
| | | | | | | | | | | | Added ability to dgram.send to send multiple buffers, _writev style. The offset and length parameters in dgram.send are now optional. Refactored the dgram benchmarks, and seperated them from net. Added docs for the new signature. Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Fixes: https://github.com/nodejs/node/issues/4302 PR-URL: https://github.com/nodejs/node/pull/4374
* test,buffer: refactor redeclarationsRich Trott2016-01-284-563/+661
| | | | | | | | | Many variables in the buffer tests are redeclared. Change them so that they are scoped appropriately. PR-URL: https://github.com/nodejs/node/pull/4893 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: fix test-tls-zero-clear-in flakinessSantiago Gimeno2016-01-281-1/+1
| | | | | | | | | | | | It can happen that the server-side socket is destroyed before the client-side socket has gracefully closed, thus causing a 'ECONNRESET' error in this socket. To solve this, also close gracefully in the server side too. PR-URL: https://github.com/nodejs/node/pull/4888 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* test: update arrow function stylecjihrig2016-01-2814-27/+27
| | | | | | | | | | | | | | | | | | This commit applies new arrow function linting rules across the codebase. As it turns out, the only offenders were in the test directory. PR-URL: https://github.com/nodejs/node/pull/4813 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
* tls_wrap: reach error reporting for UV_EPROTOFedor Indutny2016-01-271-0/+29
| | | | | | | | | | | Do not swallow error details when reporting UV_EPROTO asynchronously, and when creating artificial errors. Fix: #3692 PR-URL: https://github.com/nodejs/node/pull/4885 Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* test: remove Object.observe from testsVladimir Kurchatkin2016-01-272-14/+0
| | | | | | | | | | | | | | Testing this wasn't really useful, besides Object.observe is going to be deprecated. Also this test fails with Chakra (#4765) for obvious reason. PR-URL: https://github.com/nodejs/node/pull/4769 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
* test: refactor switchRich Trott2016-01-271-6/+6
| | | | | | | | | | `test-child-process-fork-net2.js` has a switch statement with 6 cases. Each case uses `child.send()`, passing an object for the callback. `child.send()` ignores the callback because it is not a function. Removing the unused argument. PR-URL: https://github.com/nodejs/node/pull/4870 Reviewed-By: Alexis Campailla <orangemocha@nodejs.org>
* test: remove race condition in http flood testRich Trott2016-01-271-16/+10
| | | | | | | | | Timer race results in some flakiness on slower devices in CI. Remove unneeded setTimeout() and replace booleans with common.mustCall(). PR-URL: https://github.com/nodejs/node/pull/4793 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* child_process: add shell option to spawn()cjihrig2016-01-262-0/+101
| | | | | | | | | | | | This commit adds a shell option, to spawn() and spawnSync(). This option allows child processes to be spawned with or without a shell. The option also allows a custom shell to be defined, for compatibility with exec()'s shell option. Fixes: https://github.com/nodejs/node/issues/1009 PR-URL: https://github.com/nodejs/node/pull/4598 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: scope redeclared variableRich Trott2016-01-261-7/+10
| | | | | | | | | | | `test-assert.js` redeclares a variable with `var`. This change converts it to a `const` declaration and wraps it in a standalone block to scope it to just the test that uses it. PR-URL: https://github.com/nodejs/node/pull/4854 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
* src: attach error to stack on displayErrorscjihrig2016-01-262-0/+19
| | | | | | | | | | | | | | The vm module's displayErrors option attaches error arrow messages as a hidden property. Later, core JavaScript code can optionally decorate the error stack with the arrow message. However, when user code catches an error, it has no way to access the arrow message. This commit changes the behavior of displayErrors to mean "decorate the error stack if an error occurs." Fixes: https://github.com/nodejs/node/issues/4835 PR-URL: https://github.com/nodejs/node/pull/4874 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>