From f5ce6b1ebfb555bf40ad57b134205b0c7dbef388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Tue, 21 Jun 2022 23:54:09 +0200 Subject: [PATCH] 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 Reviewed-By: Gus Caplan Reviewed-By: Matteo Collina Reviewed-By: Benjamin Gruenbaum --- test/node-api/test_buffer/test_finalizer.js | 2 +- test/parallel/test-net-write-fully-async-buffer.js | 2 +- test/parallel/test-net-write-fully-async-hex-string.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/node-api/test_buffer/test_finalizer.js b/test/node-api/test_buffer/test_finalizer.js index 372116bb3a05fc..b706c68c7c3e02 100644 --- a/test/node-api/test_buffer/test_finalizer.js +++ b/test/node-api/test_buffer/test_finalizer.js @@ -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)); diff --git a/test/parallel/test-net-write-fully-async-buffer.js b/test/parallel/test-net-write-fully-async-buffer.js index 207ae24f6a32d0..0dddb51bd76ade 100644 --- a/test/parallel/test-net-write-fully-async-buffer.js +++ b/test/parallel/test-net-write-fully-async-buffer.js @@ -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. } diff --git a/test/parallel/test-net-write-fully-async-hex-string.js b/test/parallel/test-net-write-fully-async-hex-string.js index f3115d8d2f795e..37b5cd75c1385c 100644 --- a/test/parallel/test-net-write-fully-async-hex-string.js +++ b/test/parallel/test-net-write-fully-async-hex-string.js @@ -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. }