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 <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
Trott authored and ruyadorno committed Mar 29, 2021
1 parent 98fa743 commit 796c308
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/parallel/test-worker-resource-limits.js
Original file line number Diff line number Diff line change
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 796c308

Please sign in to comment.