summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2019-12-03 04:10:39 -0800
committerRich Trott <rtrott@gmail.com>2019-12-05 08:03:24 -0800
commit7113d999dcb7e93ac1504f3ae622df61a9495a1c (patch)
treebdabd8f0d6d0736cf8f80a604455f13103abc478
parent3a4d916ea7b9c36971df66fbdf9d4e68d2e20111 (diff)
downloadandroid-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.js8
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);
});
});