From e1edbe3528a112ae5d62bf90e3a70a9af8774526 Mon Sep 17 00:00:00 2001 From: sangwook Date: Tue, 11 Nov 2025 06:56:42 +0900 Subject: [PATCH 1/2] test: prefer major GC in cppgc-object teardown --- test/addons/cppgc-object/test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/addons/cppgc-object/test.js b/test/addons/cppgc-object/test.js index acdb145ae721c4..f980b14517fb6a 100644 --- a/test/addons/cppgc-object/test.js +++ b/test/addons/cppgc-object/test.js @@ -12,6 +12,11 @@ const { CppGCed, states, kDestructCount, kTraceCount, } = require(`./build/${common.buildType}/binding`); +const GC_OPTIONS = { + type: 'major', + execution: 'beforeUserJS', +}; + assert.strictEqual(states[kDestructCount], 0); assert.strictEqual(states[kTraceCount], 0); @@ -38,6 +43,8 @@ setTimeout(common.mustCall(() => (async function() { await gcUntil( 'All old CppGCed are destroyed', () => states[kDestructCount] === count, + undefined, + GC_OPTIONS, ); // Release all the CppGCed objects, after GC we should have destructed // all of them. @@ -47,5 +54,7 @@ setTimeout(common.mustCall(() => (async function() { await gcUntil( 'All old CppGCed are destroyed', () => states[kDestructCount] === count * 2, + undefined, + GC_OPTIONS, ); })().then(common.mustCall())), 1); From e0cd64687339779047be57dece0d92701eb3bc3f Mon Sep 17 00:00:00 2001 From: sangwook Date: Tue, 11 Nov 2025 20:58:32 +0900 Subject: [PATCH 2/2] test: fix gc execution option in cppgc-object test --- test/addons/cppgc-object/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/addons/cppgc-object/test.js b/test/addons/cppgc-object/test.js index f980b14517fb6a..54bd9e0ad828c3 100644 --- a/test/addons/cppgc-object/test.js +++ b/test/addons/cppgc-object/test.js @@ -14,7 +14,7 @@ const { const GC_OPTIONS = { type: 'major', - execution: 'beforeUserJS', + execution: 'sync', }; assert.strictEqual(states[kDestructCount], 0);