Skip to content

Commit cd5290a

Browse files
committed
Workaround for node versions older than 20
1 parent fdf5538 commit cd5290a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/mocha/integration/stdin_backpressure.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@ function timeoutSignal(ms) {
4040
describe('stdin backpressuring server', function setup() {
4141
let httpURL;
4242

43-
stream.setDefaultHighWaterMark(false, 3);
43+
// Monkey-patch for different highWaterMark
44+
const oldDuplex = stream.Duplex;
45+
function newDuplex(options) {
46+
options = options || {};
47+
options.readableHighWaterMark = 3;
48+
oldDuplex.call(this, options);
49+
}
50+
newDuplex.prototype = oldDuplex.prototype;
51+
newDuplex.prototype.constructor = newDuplex;
52+
stream.Duplex = newDuplex;
4453

4554
before(function startFcgiServer(done) {
4655
function sendError(res, err) {

0 commit comments

Comments
 (0)