mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
test: increase wiggle room for memory in test-worker-resource-limits
PR-URL: https://github.com/nodejs/node/pull/37901 Fixes: https://github.com/nodejs/node/issues/37844 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
1 parent
ce300d6f76
commit
498c6b1c2a
1 file changed
+3
-2
@@ -35,9 +35,10 @@ if (!process.env.HAS_STARTED_WORKER) {
|
||||
assert.deepStrictEqual(resourceLimits, testResourceLimits);
|
||||
const array = [];
|
||||
while (true) {
|
||||
// Leave 10 % wiggle room here.
|
||||
// Leave 10% wiggle room here, and 20% on debug builds.
|
||||
const wiggleRoom = common.buildType === 'Release' ? 1.1 : 1.2;
|
||||
const usedMB = v8.getHeapStatistics().used_heap_size / 1024 / 1024;
|
||||
assert(usedMB < resourceLimits.maxOldGenerationSizeMb * 1.1);
|
||||
assert(usedMB < resourceLimits.maxOldGenerationSizeMb * wiggleRoom);
|
||||
|
||||
let seenSpaces = 0;
|
||||
for (const { space_name, space_size } of v8.getHeapSpaceStatistics()) {
|
||||
|
||||
Reference in new issue
Block a user