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 <midawson@redhat.com>
This commit is contained in:
Adam Majer authored and Michaël Zasso committed 2024-05-11 18:55:52 +02:00
1 parent 619ac79abb
commit fbce3178ba
1 file changed
+1 -1
+1 -1
View File
@@ -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);