Skip to content

Commit

Permalink
test: replace gc(true) with gc({ type: 'minor' })
Browse files Browse the repository at this point in the history
V8 considers gc(true) legacy, and the new signature is much more
expressive.

PR-URL: #43493
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
  • Loading branch information
tniessen authored and targos committed Jul 12, 2022
1 parent 462e526 commit 70d297c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/node-api/test_buffer/test_finalizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-net-write-fully-async-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-net-write-fully-async-hex-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}

Expand Down

0 comments on commit 70d297c

Please sign in to comment.