test: replace gc(true) with gc({ type: 'minor' })

V8 considers gc(true) legacy, and the new signature is much more
expressive.

PR-URL: https://github.com/nodejs/node/pull/43493
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
Tobias Nießen authored and Michaël Zasso committed 2022-07-31 09:44:57 +02:00
1 parent 7be07c719c
commit a5df207c2b
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ process.on('uncaughtException', common.mustCall((err) => {
throw new Error('finalizer error');
}));
}
global.gc(true);
global.gc({ type: 'minor' });
await tick(common.platformTimeout(100));
global.gc();
await tick(common.platformTimeout(100));
@@ -23,7 +23,7 @@ const server = net.createServer(common.mustCall(function(conn) {
}
while (conn.write(Buffer.from(data)));
global.gc(true);
global.gc({ type: 'minor' });
// The buffer allocated above should still be alive.
}
@@ -21,7 +21,7 @@ const server = net.createServer(common.mustCall(function(conn) {
}
while (conn.write(data, 'hex'));
global.gc(true);
global.gc({ type: 'minor' });
// The buffer allocated inside the .write() call should still be alive.
}