From 16495c1e7a38157d0035c015931a181bc7c63631 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 --- 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(); });