Skip to content

Commit b011cc5

Browse files
authored
test: prefer major GC in cppgc-object teardown
PR-URL: nodejs#60672 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
1 parent bed8e2a commit b011cc5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/addons/cppgc-object/test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ const {
1212
CppGCed, states, kDestructCount, kTraceCount,
1313
} = require(`./build/${common.buildType}/binding`);
1414

15+
const GC_OPTIONS = {
16+
type: 'major',
17+
execution: 'sync',
18+
};
19+
1520
assert.strictEqual(states[kDestructCount], 0);
1621
assert.strictEqual(states[kTraceCount], 0);
1722

@@ -38,6 +43,8 @@ setTimeout(common.mustCall(() => (async function() {
3843
await gcUntil(
3944
'All old CppGCed are destroyed',
4045
() => states[kDestructCount] === count,
46+
undefined,
47+
GC_OPTIONS,
4148
);
4249
// Release all the CppGCed objects, after GC we should have destructed
4350
// all of them.
@@ -47,5 +54,7 @@ setTimeout(common.mustCall(() => (async function() {
4754
await gcUntil(
4855
'All old CppGCed are destroyed',
4956
() => states[kDestructCount] === count * 2,
57+
undefined,
58+
GC_OPTIONS,
5059
);
5160
})().then(common.mustCall())), 1);

0 commit comments

Comments
 (0)