From 7113d999dcb7e93ac1504f3ae622df61a9495a1c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 3 Dec 2019 04:10:39 -0800 Subject: test: use callback arguments in getconnections test Use previously-unused callback arguments in test-child-process-fork-getconnections. PR-URL: https://github.com/nodejs/node/pull/30775 Reviewed-By: Jiawen Geng Reviewed-By: Luigi Pinca --- test/parallel/test-child-process-fork-getconnections.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/parallel/test-child-process-fork-getconnections.js b/test/parallel/test-child-process-fork-getconnections.js index 1b1ba9c0d9..b96d61238a 100644 --- a/test/parallel/test-child-process-fork-getconnections.js +++ b/test/parallel/test-child-process-fork-getconnections.js @@ -58,8 +58,10 @@ if (process.argv[2] === 'child') { const child = fork(process.argv[1], ['child']); child.on('exit', function(code, signal) { - if (!subprocessKilled) - throw new Error('subprocess died unexpectedly!'); + if (!subprocessKilled) { + assert.fail('subprocess died unexpectedly! ' + + `code: ${code} signal: ${signal}`); + } }); const server = net.createServer(); @@ -98,6 +100,8 @@ if (process.argv[2] === 'child') { child.once('message', function(m) { assert.strictEqual(m.status, 'closed'); server.getConnections(function(err, num) { + assert.ifError(err); + assert.strictEqual(num, count - (i + 1)); closeSockets(i + 1); }); }); -- cgit v1.2.3