summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2021-04-02 19:51:15 -0700
committerMichaël Zasso <targos@protonmail.com>2021-09-07 11:16:27 +0200
commit0fabd8e755c09cc090ef684f6453b3cc21a3475e (patch)
treeca3fd4b5d68a615b0cce1c2f9b298930ab278eb3
parent64fb928ec761cca8f78493f3236cb39062763947 (diff)
downloadnode-new-0fabd8e755c09cc090ef684f6453b3cc21a3475e.tar.gz
test: fix flaky test-vm-memleak
Force garbage collection so that the memory leak is more easily differentiated from ordinary not-garbage-collected memory. Refs: https://github.com/nodejs/node/pull/34289 PR-URL: https://github.com/nodejs/node/pull/38054 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
-rw-r--r--test/pummel/test-vm-memleak.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/pummel/test-vm-memleak.js b/test/pummel/test-vm-memleak.js
index b840992f30..b397cc75f6 100644
--- a/test/pummel/test-vm-memleak.js
+++ b/test/pummel/test-vm-memleak.js
@@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
-// Flags: --max_old_space_size=32
+// Flags: --max_old_space_size=32 --expose_gc
const common = require('../common');
@@ -39,6 +39,7 @@ const interval = setInterval(function() {
} catch {
}
+ global.gc();
const rss = process.memoryUsage.rss();
assert.ok(rss < 64 * 1024 * 1024,
`memory usage: ${rss} (${Math.round(rss / (1024 * 1024))} MB)`);