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 <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
ronag authored and codebytere committed Jul 8, 2020
1 parent 05cbd8f commit 3032f0f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/parallel/test-http-destroyed-socket-write2.js
Original file line number Diff line number Diff line change
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 3032f0f

Please sign in to comment.