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 GitHub committed 2026-11-19 15:40:46 +00:00
1 parent 709bd4f74a
commit ab55d75c43
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'],
);