Skip to content

Commit

Permalink
test_runner: disable highWatermark on TestsStream
Browse files Browse the repository at this point in the history
The default highWatermark of 16 on the TestsStream class can
have a substantial impact on reporting performance. This commit
sets the TestsStream highWatermark to a very large value and
lets the destination streams (which are more likely to have
meaningful highWatermarks) handle backpressure.

PR-URL: #52287
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
  • Loading branch information
cjihrig authored and marco-ippolito committed May 3, 2024
1 parent f3e8d11 commit 379535a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/internal/test_runner/tests_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const {
ArrayPrototypePush,
ArrayPrototypeShift,
NumberMAX_SAFE_INTEGER,
Symbol,
} = primordials;
const Readable = require('internal/streams/readable');
Expand All @@ -12,7 +13,11 @@ class TestsStream extends Readable {
#canPush;

constructor() {
super({ __proto__: null, objectMode: true });
super({
__proto__: null,
objectMode: true,
highWaterMark: NumberMAX_SAFE_INTEGER,
});
this.#buffer = [];
this.#canPush = true;
}
Expand Down

0 comments on commit 379535a

Please sign in to comment.