From 2a3951e535a70bf0176f2a35413f17ac8a6ad883 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Thu, 24 Sep 2026 08:37:12 +0000 Subject: [PATCH] test(fetch): make pull-dont-push exceed any socket buffer --- test/fetch/pull-dont-push.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/fetch/pull-dont-push.js b/test/fetch/pull-dont-push.js index 7c32c16200c..487da8faec7 100644 --- a/test/fetch/pull-dont-push.js +++ b/test/fetch/pull-dont-push.js @@ -12,7 +12,9 @@ const { closeServerAsPromise } = require('../utils/node-http') test('pull dont\'t push', async (t) => { let count = 0 let socket - const max = 1_000_000 + // Must exceed any socket buffer for the test to be reliable. + const chunk = Buffer.alloc(1024, 'a') + const max = 1024 * 64 // 65536 const server = createServer({ joinDuplicateHeaders: true }, (req, res) => { res.statusCode = 200 socket = res.socket @@ -20,7 +22,7 @@ test('pull dont\'t push', async (t) => { // infinite stream const stream = new Readable({ read () { - this.push('a') + this.push(chunk) if (count++ > max) { this.push(null) }