Skip to content

Commit

Permalink
test: use callback arguments in getconnections test
Browse files Browse the repository at this point in the history
Use previously-unused callback arguments in
test-child-process-fork-getconnections.

PR-URL: #30775
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Trott authored and BethGriggs committed Feb 6, 2020
1 parent 998d04d commit 4bb8d6a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/parallel/test-child-process-fork-getconnections.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
});
});
Expand Down

0 comments on commit 4bb8d6a

Please sign in to comment.