X Tutup
The Wayback Machine - https://web.archive.org/web/20220419155931/https://github.com/nodejs/node/commit/76ebc4bbd9
Skip to content
Permalink
Browse files
test: increase wiggle room for memory in test-worker-resource-limits
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 ruyadorno committed Mar 30, 2021
1 parent 649e04c commit 76ebc4bbd91bb83d09c8b0bdaab69d06846d88cb
Showing with 3 additions and 2 deletions.
  1. +3 −2 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()) {

0 comments on commit 76ebc4b

Please sign in to comment.
X Tutup