Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/fetch/pull-dont-push.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ 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

// infinite stream
const stream = new Readable({
read () {
this.push('a')
this.push(chunk)
if (count++ > max) {
this.push(null)
}
Expand Down
Loading