Skip to content

Commit

Permalink
Make test-http-server-keepalive-req-gc robust to GC heuristics (#186)
Browse files Browse the repository at this point in the history
* Fix test-http-server-keepalive-req-gc

* Format

---------

Co-authored-by: Etienne Pierre-doray <[email protected]>
  • Loading branch information
2 people authored and isheludko committed Jun 3, 2024
1 parent d2a94a3 commit b64a0f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/parallel/test-http-server-keepalive-req-gc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ const server = createServer(common.mustCall((req, res) => {
onGC(req, { ongc: common.mustCall(() => { server.close(); }) });
req.resume();
req.on('end', common.mustCall(() => {
setImmediate(() => {
setImmediate(async () => {
client.end();
global.gc();
await global.gc({ type: 'major', execution: 'async' });
await global.gc({ type: 'major', execution: 'async' });
});
}));
res.end('hello world');
Expand Down

0 comments on commit b64a0f9

Please sign in to comment.