From bfcad47ab1e8045f4a6c3bb7bb2af6e232563110 Mon Sep 17 00:00:00 2001 From: "Pooja D.P" Date: Tue, 25 Aug 2020 07:00:31 +0000 Subject: [PATCH 1/5] code:commom.mustCall() is added for the callbacks net.createServer() and server.listen() --- test/sequential/test-net-response-size.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/sequential/test-net-response-size.js b/test/sequential/test-net-response-size.js index c5d7e9b600e05d..0a38a851af8a6f 100644 --- a/test/sequential/test-net-response-size.js +++ b/test/sequential/test-net-response-size.js @@ -32,7 +32,7 @@ const cp = require('child_process'); if (process.argv[2] === 'server') { // Server - const server = net.createServer(function(conn) { + const server = net.createServer(common.mustCall(function(conn) { conn.on('data', function(data) { console.log(`server received ${data.length} bytes`); }); @@ -40,11 +40,11 @@ if (process.argv[2] === 'server') { conn.on('close', function() { server.close(); }); - }); + })); - server.listen(common.PORT, '127.0.0.1', function() { + server.listen(common.PORT, '127.0.0.1', common.mustCall(() { console.log('Server running.'); - }); + })); } else { // Client From 79a7ea65bfeccec987aa5284bd03937d3662d45d Mon Sep 17 00:00:00 2001 From: "Pooja D.P" Date: Tue, 25 Aug 2020 07:23:40 +0000 Subject: [PATCH 2/5] code:syntax error cleared --- test/sequential/test-net-response-size.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sequential/test-net-response-size.js b/test/sequential/test-net-response-size.js index 0a38a851af8a6f..e92c1276f0d1d2 100644 --- a/test/sequential/test-net-response-size.js +++ b/test/sequential/test-net-response-size.js @@ -42,7 +42,7 @@ if (process.argv[2] === 'server') { }); })); - server.listen(common.PORT, '127.0.0.1', common.mustCall(() { + server.listen(common.PORT, '127.0.0.1', common.mustCall(()=> { console.log('Server running.'); })); From 67f127863231751cb7f87a08c569d70139f832c2 Mon Sep 17 00:00:00 2001 From: "Pooja D.P" Date: Tue, 25 Aug 2020 08:28:02 +0000 Subject: [PATCH 3/5] code: common.mustcall() modified Please enter the commit message for your changes. Lines starting --- test/sequential/test-net-response-size.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sequential/test-net-response-size.js b/test/sequential/test-net-response-size.js index e92c1276f0d1d2..6b83544dc2c165 100644 --- a/test/sequential/test-net-response-size.js +++ b/test/sequential/test-net-response-size.js @@ -42,7 +42,7 @@ if (process.argv[2] === 'server') { }); })); - server.listen(common.PORT, '127.0.0.1', common.mustCall(()=> { + server.listen(common.PORT, '127.0.0.1', common.mustCall(function() { console.log('Server running.'); })); From 66b9109bc653004e14f66171a8f0adae2a20d209 Mon Sep 17 00:00:00 2001 From: "Pooja D.P" Date: Mon, 31 Aug 2020 13:58:38 +0000 Subject: [PATCH 4/5] code: common.mustcall() is added. --- test/parallel/test-http-timeout.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-http-timeout.js b/test/parallel/test-http-timeout.js index c576f1c5429101..c3f0e542d2c537 100644 --- a/test/parallel/test-http-timeout.js +++ b/test/parallel/test-http-timeout.js @@ -20,17 +20,17 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -require('../common'); +const common = require('../common'); const http = require('http'); const Countdown = require('../common/countdown'); +const MAX_COUNT = 11; -const server = http.createServer(function(req, res) { +const server = http.createServer(common.mustCall(function(req, res) { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('OK'); -}); +}, MAX_COUNT)); -const MAX_COUNT = 11; const agent = new http.Agent({ maxSockets: 1 }); const countdown = new Countdown(MAX_COUNT, () => server.close()); From a36efab22d0df27dd8d6ad501f6861af1d932c06 Mon Sep 17 00:00:00 2001 From: "Pooja D.P" Date: Mon, 31 Aug 2020 15:44:35 +0000 Subject: [PATCH 5/5] code:remove stale changes --- test/sequential/test-net-response-size.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/sequential/test-net-response-size.js b/test/sequential/test-net-response-size.js index 6b83544dc2c165..c5d7e9b600e05d 100644 --- a/test/sequential/test-net-response-size.js +++ b/test/sequential/test-net-response-size.js @@ -32,7 +32,7 @@ const cp = require('child_process'); if (process.argv[2] === 'server') { // Server - const server = net.createServer(common.mustCall(function(conn) { + const server = net.createServer(function(conn) { conn.on('data', function(data) { console.log(`server received ${data.length} bytes`); }); @@ -40,11 +40,11 @@ if (process.argv[2] === 'server') { conn.on('close', function() { server.close(); }); - })); + }); - server.listen(common.PORT, '127.0.0.1', common.mustCall(function() { + server.listen(common.PORT, '127.0.0.1', function() { console.log('Server running.'); - })); + }); } else { // Client