Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
7203924
util: implement %o and %O as formatting specifiers
gla5001 Jul 31, 2017
96147c9
test: read proper inspector message size
bzoz Aug 2, 2017
d89f9f8
inspector: allow require in Runtime.evaluate
Sep 28, 2016
f73f659
test: mitigate RegEx exceeding 80 chars
thelostone-mc Aug 3, 2017
71f2e76
test: use ciphers supported by shared OpenSSL
kapouer Aug 1, 2017
5e2cce5
n-api: optimize number API performance
jasongin Jul 19, 2017
2ee3320
test: improve multiple timers tests
jasnell Aug 4, 2017
ef8ac7b
stream: support readable/writableHWM for Duplex
guymguym Aug 4, 2017
935d34b
test: fix test-readline-interface
Azard Aug 7, 2017
574cc37
benchmark: remove unused parameters
nishijayaraj Aug 5, 2017
55aba6a
test: replace indexOf with includes
maasencioh Aug 4, 2017
30837b3
test: improve check in test-os
Trott Aug 7, 2017
06ba2da
test: fix conversion of microseconds in test
nickstanish Aug 9, 2017
a0e05e8
tools: fix tools/addon-verify.js
danbev Jul 3, 2017
e07dfff
doc: remove undef NDEBUG from addons.md
danbev Jul 3, 2017
4e15a6b
doc: fix order of AtExit callbacks in addons.md
danbev Jul 3, 2017
8433b1a
lib: use Timer.now() in readline module
Trott Aug 8, 2017
c94f346
net: use rest parameters instead of arguments
tniessen Jun 5, 2017
d3b0722
doc: add docs for AssertionError
Jul 16, 2017
5874272
test: set module loading error for aix
prakaashkpk Jul 27, 2017
2716b62
async_hooks: CHECK that resource is not empty
addaleax Aug 8, 2017
d604173
doc: clarify the position argument for fs.read
dcharbonnier Aug 3, 2017
9888bb1
doc: improve fs.read() doc text
Trott Aug 4, 2017
5d99d7d
test: add block scoping to test-readline-interface
Trott Aug 3, 2017
3f1bb0a
test: split out load-sensitive readline tests
Trott Aug 8, 2017
033773c
src: add overlooked handle to cleanup
addaleax Aug 10, 2017
0bc3124
test: properly order freeing resources in cctest
addaleax Aug 10, 2017
8ff2a5c
Revert "test: add DISABLED_ prefix to commented out test"
addaleax Aug 10, 2017
a781bb4
Revert "test: disable MultipleEnvironmentsPerIsolate"
addaleax Aug 10, 2017
c5ee34e
encoding: rudimentary TextDecoder support w/o ICU
TimothyGu Jul 30, 2017
977e228
test: make test-tls-connect checks more strict
Trott Aug 8, 2017
139b088
benchmark: Correct constructor for freelist
gareth-ellis Aug 4, 2017
2d806f4
deps: cherry-pick f19b889 from V8 upstream
alexkozy Aug 1, 2017
029567a
inspector: support extra contexts
Apr 24, 2017
7eb9f6f
test: make totalLen snake case
danbev Aug 11, 2017
b87fae9
src: remove duplicate loop
addaleax Aug 10, 2017
d7d22ea
src: add comments for cares library init refcount
addaleax Aug 10, 2017
9bbbf12
test: remove redundant `using` in cctest
XadillaX Aug 10, 2017
0eab77c
test: allow inspector to reopen with same port
gibfahn Jul 17, 2017
917ace2
n-api: add napi_get_node_version
addaleax Aug 8, 2017
ee2ae0f
doc: expanded description of buffer.slice
vishal7201 Aug 9, 2017
f83827d
src: use local isolate instead of args.GetIsolate
danbev Aug 11, 2017
82c63a5
test: add test-benchmark-arrays
Trott Aug 10, 2017
9237ef8
src: avoid creating local data variable
danbev Aug 10, 2017
1c00875
repl: include folder extensions in autocomplete
not-an-aardvark Aug 10, 2017
1168410
util: improve util.inspect performance
BridgeAR Jul 26, 2017
a6539ec
assert: optimize code path for deepEqual Maps
BridgeAR Jul 26, 2017
0de63e6
doc: fix docs style in intl.md
watilde Aug 9, 2017
20fb690
doc: fix docs style in util.md
watilde Aug 9, 2017
268a1ff
src: mention that node options are space-separated
Aug 9, 2017
b3c1c6f
benchmark: fix and extend assert benchmarks
BridgeAR Jun 28, 2017
4811fea
doc: add missing `changes:` metadata for streams
addaleax Aug 13, 2017
9e51802
doc: add missing `changes:` metadata for util
addaleax Aug 13, 2017
e0001dc
http: move utcDate to internal/http.js
jasnell Oct 17, 2016
e84c9d7
tls: add tlsSocket.disableRenegotiation()
jasnell Nov 4, 2016
fef2aa7
deps: add nghttp2 dependency
jasnell Jul 17, 2017
9623ee0
http2: introducing HTTP/2
jasnell Jul 17, 2017
3eb61b0
http2: add tests and benchmarks
jasnell Jul 17, 2017
a49146e
http2: remove redundant return in test
jasnell Jul 17, 2017
e8cc193
http2: fix documentation nits
jasnell Jul 17, 2017
be716d0
doc: include http2.md in all.md
jasnell Jul 17, 2017
9d752d5
test: fix flakiness in test-http2-client-upload
jasnell Jul 18, 2017
97f622b
test: fix flaky test-http2-client-unescaped-path on osx
jasnell Jul 18, 2017
cd0f4c6
http2: fix abort when client.destroy inside end event
jasnell Jul 19, 2017
2620769
http2: refinement and test for socketError
jasnell Jul 19, 2017
61696f1
http2: fix socketOnTimeout and a segfault
jasnell Jul 19, 2017
8f3bbd9
http2: add range support for respondWith{File|FD}
jasnell Jul 22, 2017
b778838
http2: doc and fixes to the Compatibility API
mcollina Jul 24, 2017
7824fa0
http2: make writeHead behave like HTTP/1.
mcollina Jul 24, 2017
26e1f8e
http2: address initial pr feedback
jasnell Jul 31, 2017
3e5b07a
http2: refactor trailers API
jasnell Jul 31, 2017
9a4be4a
http2: get trailers working with the compat api
jasnell Jul 31, 2017
174ab6f
http2: use static allocated arrays
jasnell Aug 1, 2017
33b03b2
http2: minor cleanup
jasnell Aug 1, 2017
b43caf9
http2: fix documentation errors
jasnell Aug 1, 2017
f46c50b
http2: add some doc detail for invalid header chars
jasnell Aug 1, 2017
efd929e
http2: fix compilation error after V8 update
jasnell Aug 3, 2017
6a30448
http2: fix linting after rebase
jasnell Aug 3, 2017
723d1af
http2: fix flakiness in timeout
jasnell Aug 3, 2017
47bf705
http2: rename some nghttp2 stream flags
kjin Aug 5, 2017
dbb9c37
test: add crypto check to http2 tests
danbev Aug 7, 2017
1e7ddb2
doc: explain browser support of http/2 without SSL
giltayar Aug 7, 2017
af85b6e
doc: fix http2 sample code for http2.md
kakts Aug 7, 2017
dd6444d
src,http2: DRY header/trailer handling code up
addaleax Aug 8, 2017
66788fc
test: increase http2 coverage
michaalbert Aug 8, 2017
92c37fe
http2: improve perf of passing headers to C++
addaleax Aug 9, 2017
59d1d56
src: remove unused http2_socket_buffer from env
addaleax Aug 10, 2017
8a0d101
http2: use per-environment buffers
addaleax Aug 10, 2017
c5740f9
http2: name padding buffer fields
addaleax Aug 10, 2017
e4854fc
test: use regular expressions in throw assertions
Jul 17, 2017
ac1b81a
lib: move deprecationWarned var
danbev Aug 11, 2017
6d9f94f
test: cover all HTTP methods that parser supports
Aug 11, 2017
230cb55
doc: fix header level typo
refack Aug 9, 2017
621c03a
doc: delint
refack Aug 9, 2017
1d40850
http2: fix [kInspect]() output for Http2Stream
evanlucas Aug 10, 2017
dd521d0
deps,tools: add missing nghttp2 license
addaleax Aug 13, 2017
56a0577
2017-08-15, Version 8.4.0 (Current)
addaleax Aug 13, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: improve multiple timers tests
PR-URL: #14616
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
jasnell authored and addaleax committed Aug 10, 2017
commit 2ee3320f2c9f8e22a7cdb4ab683ae671bcc3a208
20 changes: 6 additions & 14 deletions test/parallel/test-timers-immediate.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
const common = require('../common');
const assert = require('assert');

let immediateC;
let immediateD;

let mainFinished = false;

setImmediate(common.mustCall(function() {
Expand All @@ -35,17 +32,12 @@ setImmediate(common.mustCall(function() {

const immediateB = setImmediate(common.mustNotCall());

setImmediate(function(x, y, z) {
immediateC = [x, y, z];
}, 1, 2, 3);

setImmediate(function(x, y, z, a, b) {
immediateD = [x, y, z, a, b];
}, 1, 2, 3, 4, 5);
setImmediate(common.mustCall((...args) => {
assert.deepStrictEqual(args, [1, 2, 3]);
}), 1, 2, 3);

process.on('exit', function() {
assert.deepStrictEqual(immediateC, [1, 2, 3], 'immediateC args should match');
assert.deepStrictEqual(immediateD, [1, 2, 3, 4, 5], '5 args should match');
});
setImmediate(common.mustCall((...args) => {
assert.deepStrictEqual(args, [1, 2, 3, 4, 5]);
}), 1, 2, 3, 4, 5);

mainFinished = true;
12 changes: 5 additions & 7 deletions test/parallel/test-timers-non-integer-delay.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';
require('../common');
const common = require('../common');

/*
* This test makes sure that non-integer timer delays do not make the process
Expand All @@ -39,13 +39,11 @@ require('../common');
*/

const TIMEOUT_DELAY = 1.1;
const NB_TIMEOUTS_FIRED = 50;
let N = 50;

let nbTimeoutFired = 0;
const interval = setInterval(function() {
++nbTimeoutFired;
if (nbTimeoutFired === NB_TIMEOUTS_FIRED) {
const interval = setInterval(common.mustCall(() => {
if (--N === 0) {
clearInterval(interval);
process.exit(0);
}
}, TIMEOUT_DELAY);
}, N), TIMEOUT_DELAY);
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

const common = require('../common');
const net = require('net');
const Countdown = require('../common/countdown');

const clients = [];

Expand All @@ -19,7 +20,7 @@ const server = net.createServer(function onClient(client) {
* the list of unref timers when traversing it, and exposes the
* original issue in joyent/node#8897.
*/
clients[0].setTimeout(1, function onTimeout() {
clients[0].setTimeout(1, () => {
clients[1].setTimeout(0);
clients[0].end();
clients[1].end();
Expand All @@ -31,19 +32,16 @@ const server = net.createServer(function onClient(client) {
}
});

server.listen(0, common.localhostIPv4, function() {
let nbClientsEnded = 0;
server.listen(0, common.localhostIPv4, common.mustCall(() => {
const countdown = new Countdown(2, common.mustCall(() => server.close()));

function addEndedClient(client) {
++nbClientsEnded;
if (nbClientsEnded === 2) {
server.close();
}
{
const client = net.connect({ port: server.address().port });
client.on('end', () => countdown.dec());
}

const client1 = net.connect({ port: this.address().port });
client1.on('end', addEndedClient);

const client2 = net.connect({ port: this.address().port });
client2.on('end', addEndedClient);
});
{
const client = net.connect({ port: server.address().port });
client.on('end', () => countdown.dec());
}
}));
23 changes: 5 additions & 18 deletions test/parallel/test-timers-unref-leak.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
'use strict';
require('../common');
const assert = require('assert');
const common = require('../common');

let called = 0;
let closed = 0;

const timeout = setTimeout(function() {
called++;
}, 10);
const timeout = setTimeout(common.mustCall(), 10);
timeout.unref();

// Wrap `close` method to check if the handle was closed
const close = timeout._handle.close;
timeout._handle.close = function() {
closed++;
timeout._handle.close = common.mustCall(function() {
return close.apply(this, arguments);
};
});

// Just to keep process alive and let previous timer's handle die
setTimeout(function() {
}, 50);

process.on('exit', function() {
assert.strictEqual(called, 1);
assert.strictEqual(closed, 1);
});
setTimeout(() => {}, 50);
60 changes: 21 additions & 39 deletions test/parallel/test-timers-unref.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,77 +21,59 @@

'use strict';

require('../common');
const common = require('../common');
const assert = require('assert');

let interval_fired = false;
let timeout_fired = false;
let unref_interval = false;
let unref_timer = false;
let unref_callbacks = 0;
let checks = 0;

const LONG_TIME = 10 * 1000;
const SHORT_TIME = 100;

assert.doesNotThrow(function() {
assert.doesNotThrow(() => {
setTimeout(() => {}, 10).unref().ref().unref();
}, 'ref and unref are chainable');

assert.doesNotThrow(function() {
assert.doesNotThrow(() => {
setInterval(() => {}, 10).unref().ref().unref();
}, 'ref and unref are chainable');

setInterval(function() {
interval_fired = true;
}, LONG_TIME).unref();
setInterval(common.mustNotCall('Interval should not fire'), LONG_TIME).unref();
setTimeout(common.mustNotCall('Timer should not fire'), LONG_TIME).unref();

setTimeout(function() {
timeout_fired = true;
}, LONG_TIME).unref();

const interval = setInterval(function() {
const interval = setInterval(common.mustCall(() => {
unref_interval = true;
clearInterval(interval);
}, SHORT_TIME);
}), SHORT_TIME);
interval.unref();

setTimeout(function() {
setTimeout(common.mustCall(() => {
unref_timer = true;
}, SHORT_TIME).unref();
}), SHORT_TIME).unref();

const check_unref = setInterval(function() {
const check_unref = setInterval(() => {
if (checks > 5 || (unref_interval && unref_timer))
clearInterval(check_unref);
checks += 1;
}, 100);

setTimeout(function() {
unref_callbacks++;
this.unref();
}, SHORT_TIME);
{
const timeout =
setTimeout(common.mustCall(() => {
timeout.unref();
}), SHORT_TIME);
}

// Should not timeout the test
setInterval(function() {
this.unref();
}, SHORT_TIME);
{
// Should not timeout the test
const timeout =
setInterval(() => timeout.unref(), SHORT_TIME);
}

// Should not assert on args.Holder()->InternalFieldCount() > 0. See #4261.
{
const t = setInterval(() => {}, 1);
process.nextTick(t.unref.bind({}));
process.nextTick(t.unref.bind(t));
}

process.on('exit', function() {
assert.strictEqual(interval_fired, false,
'Interval should not fire');
assert.strictEqual(timeout_fired, false,
'Timeout should not fire');
assert.strictEqual(unref_timer, true,
'An unrefd timeout should still fire');
assert.strictEqual(unref_interval, true,
'An unrefd interval should still fire');
assert.strictEqual(unref_callbacks, 1,
'Callback should only run once');
});
23 changes: 10 additions & 13 deletions test/parallel/test-timers-unrefd-interval-still-fires.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@
const common = require('../common');

const TEST_DURATION = common.platformTimeout(1000);
const N = 3;
let nbIntervalFired = 0;
let N = 3;

const keepOpen = setTimeout(() => {
console.error('[FAIL] Interval fired %d/%d times.', nbIntervalFired, N);
throw new Error('Test timed out. keepOpen was not canceled.');
}, TEST_DURATION);
const keepOpen =
setTimeout(
common.mustNotCall('Test timed out. keepOpen was not canceled.'),
TEST_DURATION);

const timer = setInterval(() => {
++nbIntervalFired;
if (nbIntervalFired === N) {
const timer = setInterval(common.mustCall(() => {
if (--N === 0) {
clearInterval(timer);
timer._onTimeout = () => {
throw new Error('Unrefd interval fired after being cleared.');
};
timer._onTimeout =
common.mustNotCall('Unrefd interal fired after being cleared');
clearTimeout(keepOpen);
}
}, 1);
}, N), 1);

timer.unref();
21 changes: 4 additions & 17 deletions test/parallel/test-timers-unrefed-in-beforeexit.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
'use strict';

require('../common');
const assert = require('assert');
const common = require('../common');

let once = 0;

process.on('beforeExit', () => {
if (once > 1)
throw new RangeError('beforeExit should only have been called once!');

setTimeout(() => {}, 1).unref();
once++;
});

process.on('exit', (code) => {
if (code !== 0) return;

assert.strictEqual(once, 1);
});
process.on('beforeExit', common.mustCall(() => {
setTimeout(common.mustNotCall(), 1).unref();
}));
14 changes: 5 additions & 9 deletions test/parallel/test-timers-zero-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,14 @@ const assert = require('assert');
}

{
let ncalled = 0;
let ncalled = 3;

const iv = setInterval(f, 0, 'foo', 'bar', 'baz');

function f(a, b, c) {
const f = common.mustCall((a, b, c) => {
assert.strictEqual(a, 'foo');
assert.strictEqual(b, 'bar');
assert.strictEqual(c, 'baz');
if (++ncalled === 3) clearTimeout(iv);
}
if (--ncalled === 0) clearTimeout(iv);
}, ncalled);

process.on('exit', function() {
assert.strictEqual(ncalled, 3);
});
const iv = setInterval(f, 0, 'foo', 'bar', 'baz');
}