summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2014-07-31timers: backport f8193abJulien Gilli
Original commit message: timers: use uv_now instead of Date.now This saves a few calls to gettimeofday which can be expensive, and potentially subject to clock drift. Instead use the loop time which uses hrtime internally. In addition to the backport, this commit: - keeps _idleStart timers' property which is still set to Date.now() to avoid breaking existing code that uses it, even if its use is discouraged. - adds automated tests. These tests use a specific branch of libfaketime that hasn't been submitted upstream yet. libfaketime is git cloned if needed when running automated tests. Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-07-29buffer: fix sign overflow in `readUIn32BE`Fedor Indutny
`|` operation takes precendence on `+`, which will result in `new Buffer('ffffffff', 16).readUInt32BE(0)` returning `-1` instead of `ffffffff`.
2014-07-23test: fix test-https-foafsslFedor Indutny
2014-07-23test: fix test-tls-server-verifyFedor Indutny
fix #7963
2014-07-15stream2: flush extant data on read of ended streamChris Dickinson
A ReadableStream with a base64 StringDecoder backed by only one or two bytes would fail to output its partial data before ending. This fix adds a check to see if the `read` was triggered by an internal `flow`, and if so, empties any remaining data. fixes #7914. Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-07-03deps: cherry-pick eca441b2 from OpenSSLFedor Indutny
Original commit message: bn_exp.c: fix x86_64-specific crash with one-word modulus. PR: #3397 Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-30Revert "stream: start old-mode read in a next tick"Fedor Indutny
This reverts commit 2efe4ab7616669448f873b0417e9aa81221324e2.
2014-06-27zlib: do not crash on write after closeFedor Indutny
fix #7767 Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-06string_bytes: Guarantee valid utf-8 outputFelix Geisendörfer
Previously v8's WriteUtf8 function would produce invalid utf-8 output when encountering unmatched surrogate code units [1]. The new REPLACE_INVALID_UTF8 option fixes that by replacing invalid code points with the unicode replacement character. [1]: JS Strings are defined as arrays of 16 bit unsigned integers. There is no unicode enforcement, so one can easily end up with invalid unicode code unit sequences inside a string.
2014-06-06string_decoder: Improve test coverageFelix Geisendörfer
The test cases are still essentially the same, but now all possible ways of writing a buffer into the decoder are tested, which has exposed a few failing scenarios that had not been discovered so far!
2014-06-05stream: start old-mode read in a next tickFedor Indutny
Calling `.read()` in the same tick with `.on('data', ...)` may cause users missing `error` events, because no `error` listeners were set yet. fix #7618
2014-05-13child_process: spawn() does not throw TypeErrorGreg Sabia Tucker
Ensure TypeError is thrown, fix a bug where `env` option was assuming the option was actually an object. This case is especially bad because it then sets `env == null` instead of using `process.env`. Fix #7456 Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-07lib: name EventEmitter prototype methodsBen Noordhuis
Before this commit the EventEmitter methods were anonymous functions. V8 tries to infer names for anonymous functions based on the execution context but it frequently gets it wrong and when that happens, the stack trace is usually confusing and unhelpful. This commit names all methods so V8 can fall back to the method.name property. The above gotcha applies to all anonymous functions but is exacerbated for EventEmitter methods because those are invoked with a plenitude of different receivers. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-26util: format as Error if instanceof ErrorRod Vagg
Conflicts: lib/util.js test/simple/test-util-format.js This is a backport to fix #7253 Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-15url: treat \ the same as /isaacs
See https://code.google.com/p/chromium/issues/detail?id=25916 Parse URLs with backslashes the same as web browsers, by replacing all backslashes with forward slashes, except those that occur after the first # character.
2014-04-14child_process: fix deadlock when sending handlesFedor Indutny
Fix possible deadlock, when handles are sent in both direction simultaneously. In such rare cases, both sides may queue their `NODE_HANDLE_ACK` replies and wait for them. fix #7465
2014-04-08http: do not emit EOF non-readable socketFedor Indutny
Socket may become not `readable`, but http should not rely on this property and should not think that it means that no data will ever arrive from it. In fact, it may arrive in a next tick and, since `this.push(null)` was already called, it will result in a error like this: Error: stream.push() after EOF at readableAddChunk (_stream_readable.js:143:15) at IncomingMessage.Readable.push (_stream_readable.js:123:10) at HTTPParser.parserOnBody (_http_common.js:132:22) at Socket.socketOnData (_http_client.js:277:20) at Socket.EventEmitter.emit (events.js:101:17) at Socket.Readable.read (_stream_readable.js:367:10) at Socket.socketCloseListener (_http_client.js:196:10) at Socket.EventEmitter.emit (events.js:123:20) at TCP.close (net.js:479:12) fix #6784
2014-03-11crypto: do not lowercase cipher/hash namesFedor Indutny
`crypto.getCiphers()` and `crypto.getHashes()` should prefer lower-case variants of names, but should not introduce them. fix #7282
2014-03-05test: test sending a handle twiceBenoit Vallée
Added test-cluster-send-handle-twice.js testing to send a handle twice to the parent process.
2014-03-03timer: don't reschedule timer bucket in a domainGreg Brail
If two timers run on the same tick, and the first timer uses a domain, and then catches an exception and disposes of the domain, then the second timer never runs. (And even if the first timer does not dispose of the domain, the second timer could run under the wrong domain.) This happens because timer.js uses "process.nextTick()" to schedule continued processing of the timers for that tick. However, there was an exception inside a domain, then "process.nextTick()" runs under the domain of the first timer function, and will do nothing if the domain has been disposed. To avoid this, we temporarily save the value of "process.domain" before calling nextTick so that it does not run inside any domain.
2014-03-03src: domain should not replace nextTick functionTimothy J Fontaine
Previously if you cached process.nextTick and then require('domain') subsequent nextTick() calls would not be caught because enqueued functions were taking the wrong path. This keeps nextTick to a single function reference and changes the implementation details after domain has been required.
2014-02-26test: add `agent: null` http client request testNathan Rajlich
This is just the test portion from #7012 / #7189, but targetted for the v0.10 branch.
2014-02-26http: invoke createConnection when no agentNathan Rajlich
This makes it so that the user may pass in a `createConnection()` option, and they don't have to pass `agent: false` at the same time. Also adding a test for the `createConnection` option, since none was in place before. See #7014.
2014-02-25assert: Ensure reflexivity of deepEqualMike Pennisi
Ensure that the behavior of `assert.deepEqual` does not depend on argument ordering when comparing an `arguments` object with a non-`arguments` object.
2014-02-18test: make test-net-error-twice less raceyTimothy J Fontaine
2014-02-17debugger: Fix breakpoint not showing after restartFarid Neshat
The reason this wasn't working was because after restart, when restoring breakpoints the scripts wasn't loaded, so the breakpoint.script was undefined. As a fix I added another check to use breakpoint.scriptReq instead of breakpoint.script, which is the same except when the breakpoint is a function. fixes #7027
2014-02-18zlib: introduce pending close stateFedor Indutny
zlib should not crash in `close()` if the write is still in progress. fix #7101
2014-02-10net: do not re-emit stream errorsFedor Indutny
fix #7015
2014-02-08Revert "dns: validate arguments in resolve"Fedor Indutny
This reverts commit 56e80a37e0df0d131d3a3ad6426d52f887ef8e94.
2014-02-08dns: validate arguments in resolveKenan Sulayman
Mitigat C++-land assertion error, add test accordingly. fix #7070
2014-02-06fs: make unwatchFile() insensitive to pathiamdoron
2014-01-30node: do not ever close stdioFedor Indutny
Even if stdio streams are opened as file streams, we should not ever try to close them. This could be accomplished by passing `autoClose: false` in options on their creation.
2014-01-27net: make Socket destroy() re-entrance safeJun Ma
So that we are free to call socket.destroy() in error event handler. fix #6769
2014-01-26crypto: throw on SignFinal failureFedor Indutny
fix #6963
2014-01-25net: reset `endEmitted` on reconnectFedor Indutny
fix #6908
2014-01-23test: fix http-incoming-pipelined-socket-destroyAlexis Campailla
The test was calling server.close() after write on the socket had completed. However the fact that the write had completed was not valid indication that the server had received the data. This would result in a premutaure closing of the server and an ECONNRESET event on the client.
2014-01-23test: fix http-many-ended-pipelines server closeAlexis Campailla
The test was calling server.close() without waiting for the server to have received all the requests. This would cause an ECONNRESET.
2014-01-15domains: exit() only affects active domainsRyan Graham
domain.create().exit() should not clear the domain stack if the domain instance does not exist within the stack. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-01-13test: close debug client in test-debugger-clientAlexis Campailla
Killing the debuggee without first closing the socket can result in an ECONNRESET error.
2014-01-09src: OnFatalError handler must abort()Timothy J Fontaine
We are in an unrecoverable state if v8 throws a FatalError, actually ask the operating system to dump core in this case. Fixes #6836
2014-01-05stream: writes may return false but forget to emit drainayanamist
If a write is above the highWaterMark, _write still manages to fully send it synchronously, _writableState.length will be adjusted down to 0 synchronously with the write returning false, but 'drain' will not be emitted until process.nextTick. If another small write which is below highWaterMark is issued before process.nextTick happens, _writableState.needDrain will be reset to false, and the drain event will never be fired. So we should check needDrain before setting it up, which prevents it from inproperly resetting to false.
2013-12-31test: fix test-cluster-eaccess to work on windowsTimothy J Fontaine
2013-12-31cluster: report more errors to workersFedor Indutny
Some errors for listening and binding to a socket were not properly delivered to workers. fix #6767
2013-12-10fs: report correct path when EEXISTFedor Indutny
When `symlink`, `link` or `rename` report EEXIST, ENOTEMPTY or EPERM - the destination file name should be included in the error message, instead of source file name. fix #6510
2013-12-10tls: emit 'end' on .receivedShutdownFedor Indutny
NOTE: Also removed `.receivedShutdown` method of `Connection` it wasn't documented anywhere, and was rewritten with `true` after receiving `close_notify`. fix #6638
2013-12-04crypto: Make Decipher._flush() emit errors.Kai Groner
When Decipher processes a stream using an incorrect key, the DecipherFinal() method throws an unhandled exception at the end of the stream.
2013-12-02tls: fix pool usage raceFedor Indutny
When calling `encOut` in loop, `maybeInitFinished()` may invoke `clearOut`'s loop, leading to the writing of interleaved data (encrypted and cleartext) into the one shared pool. Move `maybeInitFinished()` out of the loop and add assertion for future.
2013-12-02process: document kill(0), disallow kill(O_RDWR)Sam Roberts
The null signal test existed, but only tested the case where the target process existed, not when it did not exist. Also clarified that SIGUSR1 is reserved by Node.js only for receiveing, its not at all reserved when sending a signal with kill(). kill(pid, 'O_RDWR'), or any other node constant, "worked". I fixed this by also checking for 'SIG'. The same as done in the isSignal() function. Now the signal names supported by process.kill() are the same as those supported by process.on().
2013-12-02tls: reset NPN callbacks after SNIFedor Indutny
SNI callback selects a new SSL_CTX for the connection, which doesn't have NPN callbacks set up.
2013-11-22events: fix TypeError in removeAllListenersJeremy Martin
Check that `listeners` is actually an array before trying to manipulate it because it won't be if no regular event listeners have been registered yet but there are 'removeListener' event listeners.