Skip to content

Commit

Permalink
test: reduce memory usage of test-worker-stdio
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AdamMajer authored and aduh95 committed May 5, 2024
1 parent c7e4209 commit b694bbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-worker-stdio.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b694bbe

Please sign in to comment.