Skip to content

Commit f6356fe

Browse files
Trotttargos
authored andcommitted
test: use callback arguments in getconnections test
Use previously-unused callback arguments in test-child-process-fork-getconnections. PR-URL: #30775 Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 4cb8476 commit f6356fe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/parallel/test-child-process-fork-getconnections.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ if (process.argv[2] === 'child') {
5858
const child = fork(process.argv[1], ['child']);
5959

6060
child.on('exit', function(code, signal) {
61-
if (!subprocessKilled)
62-
throw new Error('subprocess died unexpectedly!');
61+
if (!subprocessKilled) {
62+
assert.fail('subprocess died unexpectedly! ' +
63+
`code: ${code} signal: ${signal}`);
64+
}
6365
});
6466

6567
const server = net.createServer();
@@ -98,6 +100,8 @@ if (process.argv[2] === 'child') {
98100
child.once('message', function(m) {
99101
assert.strictEqual(m.status, 'closed');
100102
server.getConnections(function(err, num) {
103+
assert.ifError(err);
104+
assert.strictEqual(num, count - (i + 1));
101105
closeSockets(i + 1);
102106
});
103107
});

0 commit comments

Comments
 (0)