Skip to content

Commit 4b5fc33

Browse files
Trottcodebytere
authored andcommitted
test: add debugging output to test-net-listen-after-destroy-stdin
The test failed in CI once with a timeout but there is insufficient information to further debug. Add additional debugging information. Refactored callbacks to be arrow functions, since that seems to be the direction we're moving. PR-URL: #31698 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent f03738f commit 4b5fc33

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/parallel/test-net-listen-after-destroying-stdin.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ const net = require('net');
88

99
process.stdin.destroy();
1010

11-
const server = net.createServer(common.mustCall(function(socket) {
12-
console.log('accepted');
13-
socket.end();
14-
server.close();
11+
const server = net.createServer(common.mustCall((socket) => {
12+
console.log('accepted...');
13+
socket.end(common.mustCall(() => { console.log('finished...'); }));
14+
server.close(common.mustCall(() => { console.log('closed'); }));
1515
}));
1616

1717

18-
server.listen(0, function() {
18+
server.listen(0, common.mustCall(() => {
1919
console.log('listening...');
2020

21-
net.createConnection(this.address().port);
22-
});
21+
net.createConnection(server.address().port);
22+
}));

0 commit comments

Comments
 (0)