From db756f10d69d1bf9b33f4dc76b2b7ad1a7e44344 Mon Sep 17 00:00:00 2001 From: jongsik Date: Fri, 18 Sep 2026 16:18:02 +0900 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) }