Skip to content

Commit

Permalink
test: fix test-vm-memleak for high baseline platforms
Browse files Browse the repository at this point in the history
test-vm-memleak always fails on AIX in CI because the test checks that
total memory consumption is less than 64 Mb, but AIX uses over 100 Mb
just as a baseline. So instead, let's compare the memory consumption to
the baseline and make sure it is within 32 Mb.

PR-URL: #38062
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ash Cripps <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and targos committed Sep 7, 2021
1 parent 0fabd8e commit 007f9a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/pummel/test-vm-memleak.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ if (process.config.variables.asan) {
const assert = require('assert');
const vm = require('vm');

const baselineRss = process.memoryUsage.rss();

const start = Date.now();

const interval = setInterval(function() {
Expand All @@ -41,8 +43,8 @@ const interval = setInterval(function() {

global.gc();
const rss = process.memoryUsage.rss();
assert.ok(rss < 64 * 1024 * 1024,
`memory usage: ${rss} (${Math.round(rss / (1024 * 1024))} MB)`);
assert.ok(rss < baselineRss + 32 * 1024 * 1024,
`memory usage: ${rss} baseline: ${baselineRss}`);

// Stop after 5 seconds.
if (Date.now() - start > 5 * 1000) {
Expand Down

0 comments on commit 007f9a0

Please sign in to comment.