Skip to content

Commit 00b17b5

Browse files
isheludkoeti-p-dorayetiennep-chromium
authored
Make test-http-server-keepalive-req-gc robust to GC heuristics (nodejs#186) (nodejs#189)
* Fix test-http-server-keepalive-req-gc * Format --------- Co-authored-by: Etienne Pierre-Doray <etipdoray@gmail.com> Co-authored-by: Etienne Pierre-doray <etiennep@chromium.org>
1 parent 32379a7 commit 00b17b5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/parallel/test-http-server-keepalive-req-gc.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ const server = createServer(common.mustCall((req, res) => {
1414
onGC(req, { ongc: common.mustCall(() => { server.close(); }) });
1515
req.resume();
1616
req.on('end', common.mustCall(() => {
17-
setImmediate(() => {
17+
setImmediate(async () => {
1818
client.end();
19-
global.gc();
19+
await global.gc({ type: 'major', execution: 'async' });
20+
await global.gc({ type: 'major', execution: 'async' });
2021
});
2122
}));
2223
res.end('hello world');

0 commit comments

Comments
 (0)