diff options
author | Rich Trott <rtrott@gmail.com> | 2019-12-03 04:10:39 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-12-05 08:03:24 -0800 |
commit | 7113d999dcb7e93ac1504f3ae622df61a9495a1c (patch) | |
tree | bdabd8f0d6d0736cf8f80a604455f13103abc478 | |
parent | 3a4d916ea7b9c36971df66fbdf9d4e68d2e20111 (diff) | |
download | android-node-v8-7113d999dcb7e93ac1504f3ae622df61a9495a1c.tar.gz android-node-v8-7113d999dcb7e93ac1504f3ae622df61a9495a1c.tar.bz2 android-node-v8-7113d999dcb7e93ac1504f3ae622df61a9495a1c.zip |
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 <technicalcute@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
-rw-r--r-- | test/parallel/test-child-process-fork-getconnections.js | 8 |
1 files 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 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); }); }); |