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.

PR-URL: #37769
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
AdamMajer authored and marco-ippolito committed Jun 17, 2024
1 parent 1e429d1 commit 6001b16
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 6001b16

Please sign in to comment.