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
  • Loading branch information
ronag committed May 25, 2020
1 parent dd5f209 commit 16495c1
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 16495c1

Please sign in to comment.