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.
This commit is contained in:
Rob Wu
2020-05-02 17:20:16 +02:00
parent 7222fce684
commit 20d5d0480e

View File

@@ -83,7 +83,8 @@ describe('memory usage', function() {
cors_anywhere_child.send(null);
return;
}
http.request(request, function() {
http.request(request, function(res) {
res.destroy();
requestAgain();
}).on('error', function(error) {
done(error);