test: make test-v8-collect-gc-profile-minor-ms more robust

There can be more than one garbage collection triggered by
one gc() call and it's not controllable by Node.js.
Update the assertion to check that at least one expected
GC is there, but don't check that there aren't more.

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67547
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Joyee Cheung authored and Antoine du Hamel committed 2026-11-20 14:18:26 +01:00
1 parent 4ac51231d2
commit 57b70b3cf0
1 file changed
+1 -1
@@ -10,7 +10,7 @@ profiler.start();
global.gc({ type: 'minor', execution: 'sync' });
const profile = profiler.stop();
assert.deepStrictEqual(
assert.partialDeepStrictEqual(
profile.statistics.map(({ gcType }) => gcType),
['MinorMarkSweep'],
);