Skip to content

Commit 20d5d04

Browse files
committed
test-memory: destroy response to free socket
Starting from Node 12, the test started to fail because of intermittent socket errors, such as ECONNRESET and "socket hang up". Destroying the response before triggering a new request resolves it.
1 parent 7222fce commit 20d5d04

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/test-memory.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ describe('memory usage', function() {
8383
cors_anywhere_child.send(null);
8484
return;
8585
}
86-
http.request(request, function() {
86+
http.request(request, function(res) {
87+
res.destroy();
8788
requestAgain();
8889
}).on('error', function(error) {
8990
done(error);

0 commit comments

Comments
 (0)