From f6356fe50b43c2b296cbc9c09bdc4fdef4b32f9d Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 3 Dec 2019 04:10:39 -0800 Subject: [PATCH] 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(-) diff --git a/test/parallel/test-child-process-fork-getconnections.js b/test/parallel/test-child-process-fork-getconnections.js index 1b1ba9c0d96048..b96d61238a0dd8 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); }); });