Skip to content

Commit a73eddb

Browse files
committed
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: #67114 Signed-off-by: inoway46 <inoueyuya416@gmail.com> Assisted-by: Claude Code
1 parent 2d8a7f3 commit a73eddb

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎test/parallel/test-http2-max-session-memory-response-limits.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ async function test(kind, bodySize = 4 * 1024 * 1024) {
1616
server.on('session', (session) => sessions.add(session));
1717
server.on('stream', (stream) => {
1818
stream.on('error', () => {});
19+
// Leave the response open. Ending it before the request body arrives
20+
// makes the server send RST_STREAM(NO_ERROR), which can reach the client
21+
// together with the rejected headers and close the stream before the
22+
// client's own reset does.
1923
switch (kind) {
2024
case 'repeated-informational':
2125
for (let i = 0; i < 80; i++) {
@@ -25,15 +29,12 @@ async function test(kind, bodySize = 4 * 1024 * 1024) {
2529
break;
2630
case 'pairs':
2731
stream.respond({ ':status': 413, 'a': '1', 'b': '2', 'c': '3', 'd': '4' });
28-
stream.end();
2932
return;
3033
case 'size':
3134
stream.respond({ ':status': 413, 'x-large': 'x'.repeat(2048) });
32-
stream.end();
3335
return;
3436
}
3537
stream.respond({ ':status': 413 });
36-
stream.end();
3738
});
3839
server.listen(0);
3940
await once(server, 'listening');

0 commit comments

Comments
 (0)