From b694bbe0fcd3c17379c0b1c58c765079dc8c940e Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Tue, 16 Mar 2021 17:27:27 +0100 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. --- 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);