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 <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Robert Nagy committed 2020-05-26 16:08:58 +02:00
1 parent dcc112b7f7
commit 9949a2e1e3
1 file changed
+2 -4
@@ -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();
});