Skip to content

Commit

Permalink
test: make flaky test stricter
Browse files Browse the repository at this point in the history
Make assertions in flaky test stricter to possibly
make it easier to determine the root cause.

Refs: #4066

PR-URL: #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>
  • Loading branch information
ronag committed May 26, 2020
1 parent dcc112b commit 9949a2e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/parallel/test-http-destroyed-socket-write2.js
Expand Up @@ -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':
Expand All @@ -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();
});

0 comments on commit 9949a2e

Please sign in to comment.