Skip to content

Commit

Permalink
test: increase wiggle room for memory in test-worker-resource-limits
Browse files Browse the repository at this point in the history
PR-URL: #37901
Fixes: #37844
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
Trott authored and targos committed May 1, 2021
1 parent f055faf commit 4c5eff9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/parallel/test-worker-resource-limits.js
Expand Up @@ -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()) {
Expand Down

0 comments on commit 4c5eff9

Please sign in to comment.