From 76ebc4bbd91bb83d09c8b0bdaab69d06846d88cb Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 24 Mar 2021 20:01:44 -0700 Subject: [PATCH] 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 Reviewed-By: Antoine du Hamel --- test/parallel/test-worker-resource-limits.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-worker-resource-limits.js b/test/parallel/test-worker-resource-limits.js index 0c168bbea1a488..ffda452f6c6335 100644 --- a/test/parallel/test-worker-resource-limits.js +++ b/test/parallel/test-worker-resource-limits.js @@ -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()) {