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 GitHub committed 2024-05-10 19:31:20 +02:00
1 parent fd1e66f6cb
commit 001da4d088
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);