mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
test: fix test-vm-memleak for high baseline platforms
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: https://github.com/nodejs/node/pull/38062 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ash Cripps <acripps@redhat.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
30d7f05fef
commit
a0492ba391
@ -26,6 +26,8 @@ require('../common');
|
||||
const assert = require('assert');
|
||||
const vm = require('vm');
|
||||
|
||||
const baselineRss = process.memoryUsage.rss();
|
||||
|
||||
const start = Date.now();
|
||||
|
||||
const interval = setInterval(function() {
|
||||
@ -36,8 +38,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) {
|
||||
|
Loading…
Reference in New Issue
Block a user