0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
Commit Graph

169 Commits

Author SHA1 Message Date
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
Ben Noordhuis
b928303d83 test: move simple/test-abort-fatal-error to pummel
Move it from simple/ to pummel/ because it can take an awful long to
run to completion:

    $ time out/x64.release/node test/simple/test-abort-fatal-error.js

    real    0m8.150s
    user    0m0.328s
    sys     0m0.054s

PR-URL: https://github.com/node-forward/node/pull/91
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2014-12-06 02:37:30 +01:00
Jackson Tian
63a4268218 fs: fs.readFile should not throw uncaughtException
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-05 16:13:07 +04:00
Ben Noordhuis
13553c1332 test: fix up pummel/test-net-pingpong
Fix up a bad assumption in pummel/test-net-pingpong, namely that binding
to 'localhost' or '' means that incoming connections will have an IPv4
address.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-05-22 12:51:10 -07:00
Fedor Indutny
5d2aef17ee
crypto: move createCredentials to tls
Move `createCredentials` to `tls` module and rename it to
`createSecureContext`. Make it use default values from `tls` module:
`DEFAULT_CIPHERS` and `DEFAULT_ECDH_CURVE`.

fix #7249
2014-03-29 12:01:43 +04:00
Bryan Cantrill
e496707d39 mdb_v8: update to latest version
* ::jsstack -v prints function defintion
 * ::jsprint works with objects with only numeric properties
 * update tests to use builtin mdb_v8
 * add more symbols to postmortem script - pending upstream
   inclusion
2014-03-10 19:12:14 -07:00
Timothy J Fontaine
67dfcd55be test: pummel/net-connect-econnrefused backoff
We were trying too hard to connect, and getting timeouts instead of
the refusals, slow down how hard we try.
2014-02-25 11:58:33 -08:00
Timothy J Fontaine
d2952cce36 test: migrate pummel/keep-alive to wrk 2014-02-25 11:28:45 -08:00
Timothy J Fontaine
de56ffa58b test: pummel/*ci-reneg* handle EPIPE
When calling out to the openssl client handle the child closing and
returning EPIPE on writes
2014-02-24 18:38:41 -08:00
Timothy J Fontaine
78a854f872 test: move pummel/test-fs-largefile to disabled
This test is particularly pathological, and requires a ton of time to
run, we need to find a better way to manage it but in general this path
is fairly safe these days.
2014-02-24 17:03:28 -08:00
Timothy J Fontaine
95bb347d6c test: pummel/test-net-throttle adhere to streams
bufferSize is now a getter that shows all that has not been
acknowledged by the os, as well as in the buffer state. The test is
only looking to verify the js verified state.
2014-02-24 16:55:35 -08:00
Timothy J Fontaine
3a3b7488b5 test: pummel fs-watch-file-slow handle spurious
watch file will now generate an empty event when the file doesn't exist
initially
2014-02-24 16:54:04 -08:00
Timothy J Fontaine
e324717f8d test: remove next-tick-loops-quick
Scheduling of next ticks from within the next tick handler will result
in a tight execution loop where a timer cannot break into.

This test was invalid
2014-02-24 16:34:01 -08:00
Timothy J Fontaine
eadb4f5606 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	deps/v8/src/preparser.cc
	deps/v8/src/win32-math.h
	doc/api/http.markdown
	src/node_buffer.h
	src/node_crypto.cc
	src/node_file.cc
	src/node_http_parser.cc
2014-02-08 16:45:27 -08:00
iamdoron
1317032c97 fs: make unwatchFile() insensitive to path 2014-02-06 13:04:35 +04:00
Timothy J Fontaine
574f71444c test: move debugger repl into own section 2014-01-20 09:00:13 -08:00
Timothy J Fontaine
6cc95b06ea test: refactor to use common testcfg 2014-01-20 09:00:13 -08:00
Fedor Indutny
442d2d0cde test: ignore tests when built without OpenSSL CLI
fix #6880
2014-01-20 20:55:54 +04:00
Fedor Indutny
6f3d60388e gyp: build openssl-cli tool and use it in tests
fix #6663
2013-12-11 21:21:10 +04:00
Trevor Norris
5757642e91 node: allow nextTick infinite recursion
Removing the depth counter while processing the nextTickQueue made it
possible to run out of memory if in an infinite recursive loop using
nextTick(). There was also an edge case where too many callbacks were
pushed onto the nextTickQueue, while not actually being recursive.

This is being done to prevent possible cryptic FATAL ERROR messages from
popping up, and issues being posted about them.
2013-11-21 15:01:53 -08:00
Ben Noordhuis
515607a740 fs: make fs.watch() non-recursive by default
Fixes a behavioral regression introduced in commit 691b9eb.
2013-11-05 08:27:05 +01:00
Timothy J Fontaine
61ccaf9a97 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	ChangeLog
	deps/uv/ChangeLog
	deps/uv/include/uv-darwin.h
	deps/uv/src/unix/fsevents.c
	deps/uv/src/unix/process.c
	deps/uv/src/version.c
	doc/api/addons.markdown
	doc/api/cluster.markdown
	doc/api/http.markdown
	lib/http.js
	lib/tls.js
	src/node_crypto.cc
	src/node_http_parser.cc
	src/node_version.h
	src/pipe_wrap.cc
	src/v8abbr.h
	src/v8ustack.d
	test/simple/test-http-pipeline-flood.js
2013-10-25 11:26:05 -07:00
Dave Pacheco
720675e7db test: use proper findjsobjects output format
Closes #6329
2013-10-10 15:45:25 -07:00
Ben Noordhuis
f311963ff9 test: update require path after file move
Commit 204228b moved a few slow tests to pummel but I forgot to update
the require() path in pummel/test-debugger-repl-break-in-module.  Mea
culpa.
2013-10-01 02:55:32 +02:00
Fedor Indutny
59a075e108 contextify: fix ContextifyContext leak
Apparently, context->Global() won't be destroyed if the context itself
isn't marked as weak and independent.

Also, the weakness flag should be cleared once the weak callback is
executed, otherwise we'll get crashes in Debug builds.

fix #6115 and #6201
2013-09-15 00:56:11 +04:00
Ben Noordhuis
204228b57f test: move slow tests to test/pummel/
Slowness being somewhat subjective but determined by running the
test suite a few times and picking off everything that consistently
clocks in at 2 seconds or more.

Honorable mention for simple/test-tls-server-large-request, it often
runs for 10 (!) seconds or more.
2013-09-09 11:05:40 +02:00
Ben Noordhuis
b4b3a4deaf test: move slow test from simple/ to pummel/
Move simple/test-http-many-keep-alive-connections to the pummel/
directory, it takes about 2.5 seconds to complete.
2013-09-05 21:04:31 +02:00
Trevor Norris
8a272cabe2 test: move smalloc segfault tests to pummel
These tests take a while to complete, and the issue only potentially
appears under heavy load.
2013-08-30 13:55:53 -07:00
Ben Noordhuis
a1ea8a27e6 test: update tests after internal api change
Commit 0aa1335 changes the way timeout events are dispatched. Update
two tests that still used the old way.
2013-08-15 22:20:15 +02:00
Timothy J Fontaine
b26d346b57 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	deps/v8/test/cctest/test-api.cc
	lib/events.js
	lib/http.js
2013-08-06 11:59:17 -07:00
Ben Noordhuis
98db7babcc test: fix pummel/test-net-connect-memleak
* Run the garbage collector before creating the big array. It doesn't
  matter now but if in the future something in node.js core creates
  a lot of reclaimable garbage, that will break the test's expectation.

* The first RSS check was being done too late. The garbage collector
  might have run before the check, throwing off the 'reclaimed memory'
  calculation.

* Due to changes in how V8 represents the big array internally, the
  actual memory usage is just below 256 MB on x64. Update the test's
  expectation.
2013-08-01 16:07:46 +02:00
Bert Belder
bdc5881169 Merge branch 'v0.10'
Conflicts:
	tools/test.py
2013-05-13 11:13:39 -07:00
Timothy J Fontaine
72c58158f7 test: fix pummel/test-net-many-clients.js
client sockets no longer emit 'connect' event inside the
requestListener, update test-net-many-clients to reflect that
2013-05-08 19:31:45 -07:00
Manav Rathi
d20576165a tls: expose SSL_CTX_set_timeout via tls.createServer
Add the `sessionTimeout` integral value to the list of options
recognized by `tls.createServer`.

This option will be useful for applications which need frequently
establish short-lived TLS connections to the same endpoint. The TLS
tickets RFC is an ideal option to reduce the socket setup overhead
for such scenarios, but the default ticket timeout value (5
minutes) is too low to be useful.
2013-03-26 01:37:49 +01:00
isaacs
32ac8c0b69 test: Pass cli flags in pummel/test-regress-GH-892 2013-03-06 11:44:29 -08:00
Ben Noordhuis
c11612026f net: omit superfluous 'connect' event
Don't emit a 'connect' event on sockets that are handed off to
net.Server 'connection' event listeners.

1. It's superfluous because the connection has already been established
   at that point.

2. The implementation is arguably wrong because the event is emitted on
   the same tick of the event loop while the rule of thumb is to always
   emit it on the next one.

This has been tried before in commit f0a440d but was reverted again in
ede1acc because the change was incomplete (at least one test hadn't
been updated).

Fixes #1047 (again).
2013-03-01 02:09:36 +01:00
Ben Noordhuis
14a4245051 net: don't suppress ECONNRESET
Let ECONNRESET network errors bubble up so clients can detect them.

Commit c4454d2e suppressed and turned them into regular end-of-stream
events to fix the then-failing simple/test-regress-GH-1531 test. See
also issue #1571 for (scant) details.

It turns out that special handling is no longer necessary. Remove the
special casing and let the error bubble up naturally.

pummel/test-https-ci-reneg-attack and pummel/test-tls-ci-reneg-attack
are updated because they expected an EPIPE error code that is now an
ECONNRESET. Suppression of the ECONNRESET prevented the test from
detecting that the connection has been severed whereupon the next
write would fail with an EPIPE.

Fixes #1776.
2013-02-11 12:31:21 -08:00
Ben Noordhuis
acd0df4ad9 test: fix pummel test out-of-memory errors
Fix the following OOM error in pummel/test-net-connect-memleak
and pummel/test-tls-connect-memleak:

  FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of
  memory

Commit v8/v8@91afd39 increases the size of the deoptimization table
to the extent that a 64M float array pushes it over the brink. Switch
to SMIs so it stays below the limit.

pummel/test-net-connect-memleak is still failing albeit with a different
error this time. Needs further investigation.

  === release test-net-connect-memleak ===
  Path: pummel/test-net-connect-memleak
  -64 kB reclaimed
  assert.js:102
    throw new assert.AssertionError({
          ^
  AssertionError: false == true
      at done [as _onTimeout] (/home/bnoordhuis/src/nodejs/master/
  test/pummel/test-net-connect-memleak.js:48:3)
      at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
      at process._makeCallback (node.js:306:20)
2013-01-27 22:01:14 +01:00
isaacs
f63af64eb8 test-pummel: Add call validation in net-write-callbacks 2012-12-19 10:55:23 -08:00
isaacs
f3f4e290e0 test: 2 resume() calls needed to flush streams 2012-12-19 10:55:23 -08:00
isaacs
77ed12fe7a Merge remote-tracking branch 'ry/v0.8' into master
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/test/test-spawn.c
	deps/uv/uv.gyp
	src/cares_wrap.cc
	src/node.cc
	src/node_version.h
	test/simple/test-buffer.js
	tools/gyp/pylib/gyp/common.py
	tools/install.py
2012-12-13 16:57:58 -08:00
Ben Noordhuis
121ed91331 tls: fix tls.connect() resource leak
The 'secureConnect' event listener was attached with .on(), which blocked it
from getting garbage collected. Use .once() instead.

Fixes #4308.
2012-11-26 01:51:05 +01:00
Ben Noordhuis
4cb17cb219 net: fix net.connect() resource leak
The 'connect' event listener was attached with .on(), which blocked it from
getting garbage collected. Use .once() instead.

Fixes #4308.
2012-11-24 15:27:14 +01:00
Ben Noordhuis
8ac017eba7 test: fix pummel/test-crypto-dh, pummel/test-dh-regr
Forgotten in the switch to buffers as the default output in 3570f20.

Fixes #4188.
2012-10-24 15:37:34 +02:00
Bryan Cantrill
cc1b09d6b7 test: add tests for postmortem and DTrace support 2012-09-21 01:51:57 +02:00
Ben Noordhuis
3806cf0d64 test: set rejectUnauthorized in tls/https tests
Update the tls and https tests to explicitly set rejectUnauthorized instead of
relying on the NODE_TLS_REJECT_UNAUTHORIZED environment variable getting set.
2012-09-15 00:19:30 +02:00
Ben Noordhuis
35607f3a2d tls, https: validate server certificate by default
This commit changes the default value of the rejectUnauthorized option from
false to true.

What that means is that tls.connect(), https.get() and https.request() will
reject invalid server certificates from now on, including self-signed
certificates.

There is an escape hatch: if you set the NODE_TLS_REJECT_UNAUTHORIZED
environment variable to the literal string "0", node.js reverts to its
old behavior.

Fixes #3949.
2012-09-15 00:19:06 +02:00
Ben Noordhuis
972cdf82f1 Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	deps/uv/include/uv.h
	src/node_crypto.cc
2012-09-04 15:02:20 +02:00
isaacs
dec16aa5c2 Test client renegotiation attacks on HTTPS
This test should output roughly the same results as the tls ci-reneg attack
pummel test.  However, it does not.
2012-08-29 12:26:28 -07:00
Ben Noordhuis
28d30346f4 test: use common.PORT in pummel/test-net-timeout2 2012-08-17 14:03:26 +02:00