From 33a550b4fdcdaa2c591c56efef6dceff6b186c1a Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Fri, 10 May 2024 19:31:20 +0200 Subject: [PATCH] test: reduce memory usage of test-worker-stdio On systems with limited memory and that are compiled with debugging information, this particular test is causing OOM condition especially as it is run in parallel. Even when run with a stripped binary as an input, the test consumes upward of 250M RSS. By limiting the input stream to the 1M, the stream is still buffering but memory consumption is similar to other parallel tests. PR-URL: https://github.com/nodejs/node/pull/37769 Reviewed-By: Michael Dawson --- test/parallel/test-worker-stdio.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-worker-stdio.js b/test/parallel/test-worker-stdio.js index d4c008713bf918..82c2edad544e79 100644 --- a/test/parallel/test-worker-stdio.js +++ b/test/parallel/test-worker-stdio.js @@ -27,7 +27,7 @@ if (isMainThread) { const passed = new BufferingWritable(); const w = new Worker(__filename, { stdin: true, stdout: true }); - const source = fs.createReadStream(process.execPath); + const source = fs.createReadStream(process.execPath, { end: 1_000_000 }); source.pipe(w.stdin); source.pipe(original); w.stdout.pipe(passed);