Skip to content

Commit 2c0f302

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 <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 2224211 commit 2c0f302

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

Lines changed: 7 additions & 7 deletions
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)