From c8f38fac87716c8c6e52ff1072c18b2f41dafe33 Mon Sep 17 00:00:00 2001 From: Yuya Inoue <65857152+inoway46@users.noreply.github.com> Date: Mon, 23 Nov 2026 20:15:53 +0900 Subject: [PATCH] test: keep response open in http2 response limits test The server ended the response before the request body arrived, so it also sent RST_STREAM(NO_ERROR). When that frame reaches the client in the same read as the rejected headers, the stream is closed by the peer reset before the client's own reset is sent. On v26.x the request then closes without an 'error' event and the test times out. Leave the response open so that only the client resets the stream. Refs: https://github.com/nodejs/node/pull/67114 Signed-off-by: inoway46 Assisted-by: Claude Code PR-URL: https://github.com/nodejs/node/pull/67656 Refs: https://github.com/nodejs/node/actions/runs/44631511460 Reviewed-By: James M Snell Reviewed-By: Filip Skokan --- .../test-http2-max-session-memory-response-limits.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-http2-max-session-memory-response-limits.js b/test/parallel/test-http2-max-session-memory-response-limits.js index ca4458725d0..e0f71d88ba4 100644 --- a/test/parallel/test-http2-max-session-memory-response-limits.js +++ b/test/parallel/test-http2-max-session-memory-response-limits.js @@ -16,6 +16,10 @@ async function test(kind, bodySize = 4 * 1024 * 1024) { server.on('session', (session) => sessions.add(session)); server.on('stream', (stream) => { stream.on('error', () => {}); + // Leave the response open. Ending it before the request body arrives + // makes the server send RST_STREAM(NO_ERROR), which can reach the client + // together with the rejected headers and close the stream before the + // client's own reset does. switch (kind) { case 'repeated-informational': for (let i = 0; i < 80; i++) { @@ -25,15 +29,12 @@ async function test(kind, bodySize = 4 * 1024 * 1024) { break; case 'pairs': stream.respond({ ':status': 413, 'a': '1', 'b': '2', 'c': '3', 'd': '4' }); - stream.end(); return; case 'size': stream.respond({ ':status': 413, 'x-large': 'x'.repeat(2048) }); - stream.end(); return; } stream.respond({ ':status': 413 }); - stream.end(); }); server.listen(0); await once(server, 'listening');