From da5e970a8ccb155b81374cc835a09246a5ee51d6 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sun, 24 May 2020 17:23:02 +0200 Subject: [PATCH] test: make flaky test stricter Make assertions in flaky test stricter to possibly make it easier to determine the root cause. Refs: https://github.com/nodejs/node/issues/4066 PR-URL: https://github.com/nodejs/node/pull/33539 Reviewed-By: Ruben Bridgewater Reviewed-By: Matteo Collina Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- test/parallel/test-http-destroyed-socket-write2.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-http-destroyed-socket-write2.js b/test/parallel/test-http-destroyed-socket-write2.js index 551cea19829d93..6878b16085f0c3 100644 --- a/test/parallel/test-http-destroyed-socket-write2.js +++ b/test/parallel/test-http-destroyed-socket-write2.js @@ -47,6 +47,7 @@ server.listen(0, function() { } req.on('error', common.mustCall(function(er) { + assert.strictEqual(req.res, null); switch (er.code) { // This is the expected case case 'ECONNRESET': @@ -73,10 +74,7 @@ server.listen(0, function() { server.close(); })); - req.on('response', function(res) { - res.on('data', common.mustNotCall('Should not receive response data')); - res.on('end', common.mustNotCall('Should not receive response end')); - }); + req.on('response', common.mustNotCall()); write(); });