summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* crypto: do not lowercase cipher/hash namesFedor Indutny2014-03-111-0/+2
| | | | | | | `crypto.getCiphers()` and `crypto.getHashes()` should prefer lower-case variants of names, but should not introduce them. fix #7282
* test: test sending a handle twiceBenoit Vallée2014-03-051-0/+56
| | | | | Added test-cluster-send-handle-twice.js testing to send a handle twice to the parent process.
* timer: don't reschedule timer bucket in a domainGreg Brail2014-03-031-0/+76
| | | | | | | | | | | | | | | | 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.
* src: domain should not replace nextTick functionTimothy J Fontaine2014-03-032-0/+31
| | | | | | | | 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.
* test: add `agent: null` http client request testNathan Rajlich2014-02-261-0/+47
| | | | | This is just the test portion from #7012 / #7189, but targetted for the v0.10 branch.
* http: invoke createConnection when no agentNathan Rajlich2014-02-261-0/+47
| | | | | | | | | | | 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.
* assert: Ensure reflexivity of deepEqualMike Pennisi2014-02-251-0/+5
| | | | | | Ensure that the behavior of `assert.deepEqual` does not depend on argument ordering when comparing an `arguments` object with a non-`arguments` object.
* test: make test-net-error-twice less raceyTimothy J Fontaine2014-02-181-2/+5
|
* debugger: Fix breakpoint not showing after restartFarid Neshat2014-02-171-1/+10
| | | | | | | | | | 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
* zlib: introduce pending close stateFedor Indutny2014-02-181-0/+38
| | | | | | zlib should not crash in `close()` if the write is still in progress. fix #7101
* net: do not re-emit stream errorsFedor Indutny2014-02-101-0/+50
| | | | fix #7015
* Revert "dns: validate arguments in resolve"Fedor Indutny2014-02-081-27/+0
| | | | This reverts commit 56e80a37e0df0d131d3a3ad6426d52f887ef8e94.
* dns: validate arguments in resolveKenan Sulayman2014-02-081-0/+27
| | | | | | Mitigat C++-land assertion error, add test accordingly. fix #7070
* fs: make unwatchFile() insensitive to pathiamdoron2014-02-061-0/+23
|
* node: do not ever close stdioFedor Indutny2014-01-302-1/+42
| | | | | | 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.
* net: make Socket destroy() re-entrance safeJun Ma2014-01-271-0/+33
| | | | | | So that we are free to call socket.destroy() in error event handler. fix #6769
* crypto: throw on SignFinal failureFedor Indutny2014-01-261-0/+13
| | | | fix #6963
* net: reset `endEmitted` on reconnectFedor Indutny2014-01-251-0/+3
| | | | fix #6908
* test: fix http-incoming-pipelined-socket-destroyAlexis Campailla2014-01-231-7/+15
| | | | | | | | | 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.
* test: fix http-many-ended-pipelines server closeAlexis Campailla2014-01-231-4/+6
| | | | | The test was calling server.close() without waiting for the server to have received all the requests. This would cause an ECONNRESET.
* domains: exit() only affects active domainsRyan Graham2014-01-151-0/+36
| | | | | | | 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>
* test: close debug client in test-debugger-clientAlexis Campailla2014-01-131-3/+8
| | | | | Killing the debuggee without first closing the socket can result in an ECONNRESET error.
* src: OnFatalError handler must abort()Timothy J Fontaine2014-01-091-0/+39
| | | | | | | We are in an unrecoverable state if v8 throws a FatalError, actually ask the operating system to dump core in this case. Fixes #6836
* stream: writes may return false but forget to emit drainayanamist2014-01-051-0/+73
| | | | | | | | | | | | | | 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.
* test: fix test-cluster-eaccess to work on windowsTimothy J Fontaine2013-12-311-16/+19
|
* cluster: report more errors to workersFedor Indutny2013-12-311-0/+59
| | | | | | | Some errors for listening and binding to a socket were not properly delivered to workers. fix #6767
* fs: report correct path when EEXISTFedor Indutny2013-12-101-1/+28
| | | | | | | | 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
* tls: emit 'end' on .receivedShutdownFedor Indutny2013-12-101-0/+58
| | | | | | | | NOTE: Also removed `.receivedShutdown` method of `Connection` it wasn't documented anywhere, and was rewritten with `true` after receiving `close_notify`. fix #6638
* crypto: Make Decipher._flush() emit errors.Kai Groner2013-12-041-0/+15
| | | | | | When Decipher processes a stream using an incorrect key, the DecipherFinal() method throws an unhandled exception at the end of the stream.
* tls: fix pool usage raceFedor Indutny2013-12-021-0/+69
| | | | | | | | | 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.
* process: document kill(0), disallow kill(O_RDWR)Sam Roberts2013-12-021-1/+7
| | | | | | | | | | | | | 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().
* tls: reset NPN callbacks after SNIFedor Indutny2013-12-021-1/+9
| | | | | SNI callback selects a new SSL_CTX for the connection, which doesn't have NPN callbacks set up.
* events: fix TypeError in removeAllListenersJeremy Martin2013-11-221-0/+7
| | | | | | 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.
* events: do not accept NaN in setMaxListenersFedor Indutny2013-11-191-0/+12
|
* dgram: fix abort when getting `fd` of closed dgramFedor Indutny2013-11-191-0/+9
| | | | | | | | | | | | | v8's `messages.js` file's `CallSiteGetMethodName` is running through all object properties and getter to figure out method name of function that appears in stack trace. This run-through will also read `fd` property of `UDPWrap` instance's javascript object, making `UNWRAP()` fail. As a simple alternative to the test case above, one could just keep reference to the dgram handle and try accessing `handle.fd` after it has been fully closed. fix #6536
* tls: handle `ssl.start()` errorsFedor Indutny2013-11-131-0/+25
|
* events: don't call once twiceTim Wood2013-11-131-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | Emitting an event within a `EventEmitter#once` callback of the same event name will cause subsequent `EventEmitter#once` listeners of the same name to be called multiple times. var emitter = new EventEmitter(); emitter.once('e', function() { emitter.emit('e'); console.log(1); }); emitter.once('e', function() { console.log(2); }); emitter.emit('e'); // Output // 2 // 1 // 2 Fix the issue, by calling the listener method only if it was not already called.
* repl: do not insert duplicates into completionsMaciej Małecki2013-11-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Fix invalid `hasOwnProperty` function usage. For example, before in the REPL: ``` > Ar<Tab> Array Array ArrayBuffer ``` Now: ``` > Ar<Tab> Array ArrayBuffer ``` Fixes #6255. Closes #6498.
* tls: prevent stalls by using read(0)Fedor Indutny2013-11-091-0/+75
| | | | | | | Do not `.push()` the same data as just passed to `.ondata()`, it may be read by 'data' event listeners. fix #6277
* crypto: clear errors from verify failureTimothy J Fontaine2013-10-181-0/+81
| | | | | | | OpenSSL will push errors onto the stack when a verify fails, which can disrupt TLS and other routines if we don't clear the error stack Fixes #6304
* http: provide backpressure for pipeline floodisaacs2013-10-161-0/+114
| | | | | | | | | If a client sends a lot more pipelined requests than we can handle, then we need to provide backpressure so that the client knows to back off. Do this by pausing both the stream and the parser itself when the responses are not being read by the downstream client. Backport of 085dd30
* test: use proper findjsobjects output formatDave Pacheco2013-10-101-1/+1
| | | | Closes #6329
* fs: fix fs.truncate() file content zeroing bugBen Noordhuis2013-10-081-0/+44
| | | | | | | | | | | | | | | | fs.truncate() and its synchronous sibling are implemented in terms of open() + ftruncate(). Unfortunately, it opened the target file with mode 'w' a.k.a. 'write-only and create or truncate at open'. The subsequent call to ftruncate() then moved the end-of-file pointer from zero to the requested offset with the net result of a file that's neatly truncated at the right offset and filled with zero bytes only. This bug was introduced in commit 168a5557 but in fairness, before that commit fs.truncate() worked like fs.ftruncate() so it seems we've never had a working fs.truncate() until now. Fixes #6233.
* readline: handle input starting with control charsEric Schrock2013-09-231-0/+12
| | | | | Handle control characters only when there is a single byte in the stream, otherwise fall through to the standard multibyte handling.
* tls: don't push() incoming data when ondata is setNathan Rajlich2013-09-131-0/+54
| | | | | | Otherwise the data ends up "on the wire" twice, and switching between consuming the stream using `ondata` vs. `read()` would yield duplicate data, which was bad.
* tls: fix setting NPN protocolsFedor Indutny2013-09-091-2/+12
| | | | | | | | | The NPN protocols was set on `require('tls')` or `global` object instead of being a local property. This fact lead to strange persistence of NPN protocols, and sometimes incorrect protocol selection (when no NPN protocols were passed in client options). fix #6168
* stream: objectMode transforms allow falsey valuesisaacs2013-09-051-0/+53
| | | | Closes #6183
* stream: Pass 'buffer' encoding to decoded writablesisaacs2013-08-271-0/+60
| | | | | | | | Since the encoding is no longer relevant once it is decoded to a Buffer, it is confusing and incorrect to pass the encoding as 'utf8' or whatever in those cases. Closes #6119
* fs: use correct self reference for autoClose testGil Pedersen2013-08-201-10/+16
|
* stream: Throw on 'error' if listeners removedisaacs2013-08-191-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | In this situation: writable.on('error', handler); readable.pipe(writable); writable.removeListener('error', handler); writable.emit('error', new Error('boom')); there is actually no error handler, but it doesn't throw, because of the fix for stream.once('error', handler), in 23d92ec. Note that simply reverting that change is not valid either, because otherwise this will emit twice, being handled the first time, and then throwing the second: writable.once('error', handler); readable.pipe(writable); writable.emit('error', new Error('boom')); Fix this with a horrible hack to make the stream pipe onerror handler added before any other userland handlers, so that our handler is not affected by adding or removing any userland handlers. Closes #6007.