Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fe5b710
build: add option to select VS version
greenjava Jan 12, 2016
8bf5b33
crypto: clear error stack in ECDH::Initialize
indutny Jan 14, 2016
0d0a5ed
debugger: remove variable redeclarations
Trott Jan 11, 2016
dcaf6fd
doc: clarify protocol default in http.request()
cjihrig Jan 15, 2016
43dfd03
doc: update branch-diff arguments in release doc
rvagg Jan 14, 2016
01bdafe
doc: fix named anchors in addons.markdown and http.markdown
MichaelTheriot Jan 15, 2016
a6c242f
doc: add path property to Write/ReadStream in fs.markdown
claudiorodriguez Dec 20, 2015
056b078
doc: clarify explanation of first stream section
vccortez Dec 10, 2015
a8330f7
events: make sure console functions exist
Dec 30, 2015
2879395
fs: add autoClose option to fs.createWriteStream
saquibkhan Nov 29, 2015
c171294
http: improves expect header handling
designfrontier Dec 31, 2015
16ef250
tools: enable no-extra-semi rule in eslint
targos Jan 15, 2016
f0ee088
lib,test: remove extra semicolons
targos Jan 15, 2016
c6ac464
querystring: improve parse() performance
mscdex Jan 13, 2016
8104d9d
repl: make sure historyPath is trimmed
evanlucas Jan 5, 2016
6988d2e
src: don't check failure with ERR_peek_error()
bnoordhuis Jan 17, 2016
848b04b
node: allow preload modules with -i
evanlucas Jan 14, 2016
4254508
v8,src: expose statistics about heap spaces
bripkens Dec 29, 2015
f221a43
buffer: make byteLength work with Buffer correctly
JacksonTian Jan 18, 2016
d533364
readline: Remove XXX and output debuglog
kohei-takata Jan 15, 2016
3af206d
src: return UV_EAI_NODATA on empty lookup
cjihrig Jan 15, 2016
399db04
test: fix tls-multi-key race condition
santigimeno Nov 22, 2015
14061c6
buffer: remove unnecessary TODO comments
pgeiss Jan 16, 2016
eb2b8c6
module: cache stat() results more aggressively
bnoordhuis Jan 7, 2016
8f4f5b3
tools: enable space-in-parens ESLint rule
silverwind Jan 19, 2016
a39b28b
test: fix issues for space-in-parens ESLint rule
silverwind Jan 19, 2016
a347cd7
test: make test-cluster-disconnect-leak reliable
Trott Jan 18, 2016
426ff82
stream: prevent object map change in ReadableState
evanlucas Jan 19, 2016
8a11b8c
doc: restore ICU third-party software licenses
richardlau Jan 19, 2016
fe23f42
tools: fix license-builder.sh for ICU
richardlau Jan 19, 2016
a2c257a
src: fix negative values in process.hrtime()
bnoordhuis Jan 19, 2016
dd88256
2016-01-20, Version 5.5.0 (Stable)
evanlucas Jan 20, 2016
2d46ea0
Working on v5.5.1
evanlucas Jan 20, 2016
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: make test-cluster-disconnect-leak reliable
Previously, test-cluster-disconnect-leak had two issues:

* Magic numbers: How many times to spawn a worker was determined through
empirical experimentation. This means that as new platforms and new
CPU/RAM configurations are tested, the magic numbers require more
and more refinement. This brings us to...

* Non-determinism: The test *seems* to fail all the time when the bug
it tests for is present, but it's really a judgment based on sampling.
"Oh, with 8 workers per CPU, it fails about 80% of the time. Let's try
16..."

This revised version of the test takes a different approach. The fix
for the bug that the test was written for means that the `disconnect`
event will fire reliably for a single worker. So we check for that and
the test still fails when the fix is not in the code base and succeeds
when it is.

Advantages of this approach include:

* The test runs much faster.
* The test now works on Windows. The previous version skipped Windows.
* The test should be reliable on any new platform regardless of CPU and
RAM.

Ref: #4674

PR-URL: #4736
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
  • Loading branch information
Trott authored and evanlucas committed Jan 20, 2016
commit a347cd793f3e42fdec73d5e83d92dc53f41c40e8
46 changes: 14 additions & 32 deletions test/sequential/test-cluster-disconnect-leak.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,29 @@
'use strict';
// Flags: --expose-internals

// Test fails in Node v5.4.0 and passes in v5.4.1 and newer.

const common = require('../common');
const assert = require('assert');
const net = require('net');
const cluster = require('cluster');
const handles = require('internal/cluster').handles;
const os = require('os');

if (common.isWindows) {
console.log('1..0 # Skipped: This test does not apply to Windows.');
return;
}
const noop = () => {};

cluster.schedulingPolicy = cluster.SCHED_NONE;

if (cluster.isMaster) {
const cpus = os.cpus().length;
const tries = cpus > 8 ? 128 : cpus * 16;

const worker1 = cluster.fork();
worker1.on('message', common.mustCall(() => {
worker1.disconnect();
for (let i = 0; i < tries; ++ i) {
const w = cluster.fork();
w.on('online', common.mustCall(w.disconnect));
}
}));

cluster.on('exit', common.mustCall((worker, code) => {
assert.strictEqual(code, 0, 'worker exited with error');
}, tries + 1));

process.on('exit', () => {
assert.deepEqual(Object.keys(cluster.workers), []);
assert.strictEqual(Object.keys(handles).length, 0);
});
const worker = cluster.fork();

// This is the important part of the test: Confirm that `disconnect` fires.
worker.on('disconnect', common.mustCall(noop));

// These are just some extra stuff we're checking for good measure...
worker.on('exit', common.mustCall(noop));
cluster.on('exit', common.mustCall(noop));

cluster.disconnect();
return;
}

var server = net.createServer();
const server = net.createServer();

server.listen(common.PORT, function() {
process.send('listening');
});
server.listen(common.PORT);