From 3f9cec3f51c19e57dfe85a87017cb210ad6d7bda Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 8 Feb 2020 06:30:41 -1000 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/31698 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater --- .../test-net-listen-after-destroying-stdin.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/parallel/test-net-listen-after-destroying-stdin.js b/test/parallel/test-net-listen-after-destroying-stdin.js index 5a4c8f4f65c55f..4ffec304bec008 100644 --- a/test/parallel/test-net-listen-after-destroying-stdin.js +++ b/test/parallel/test-net-listen-after-destroying-stdin.js @@ -8,15 +8,15 @@ const net = require('net'); process.stdin.destroy(); -const server = net.createServer(common.mustCall(function(socket) { - console.log('accepted'); - socket.end(); - server.close(); +const server = net.createServer(common.mustCall((socket) => { + console.log('accepted...'); + socket.end(common.mustCall(() => { console.log('finished...'); })); + server.close(common.mustCall(() => { console.log('closed'); })); })); -server.listen(0, function() { +server.listen(0, common.mustCall(() => { console.log('listening...'); - net.createConnection(this.address().port); -}); + net.createConnection(server.address().port); +}));