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
12 changes: 11 additions & 1 deletion test/http2-pipelining-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,12 @@ test('fetch POST bodies dispatch concurrently on the same h2 session instead of
sessions.add(session)
})

server.on('stream', stream => {
server.on('stream', (stream, headers) => {
if (headers[':path'] === '/warmup') {
stream.respond({ ':status': 200 })
stream.end('warm')
return
}
// Hold every stream open instead of responding immediately, so a
// serialized client would never let the second request's headers
// reach the server until the first one's stream is released.
Expand All @@ -245,6 +250,11 @@ test('fetch POST bodies dispatch concurrently on the same h2 session instead of

const origin = `http://127.0.0.1:${server.address().port}`

// Get the SETTINGS round-trip out of the way. While it is still pending
// the client counts as busy, and the pool would answer the second POST
// with a fresh connection instead of another stream.
await (await fetch(`${origin}/warmup`, { dispatcher, signal: AbortSignal.timeout(5000) })).text()

const first = fetch(origin, { method: 'POST', body: '{"first":1}', dispatcher })
// Wait for the first request's stream to actually open before dispatching
// the second -- this reproduces the exact ordering #5494 reported
Expand Down
Loading