Skip to content

Commit e6f4ddd

Browse files
committed
Fix another intermittent test failure
Co-authored by: Claude / Sonnet 5.5
1 parent 3cd26c4 commit e6f4ddd

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

‎test/org/apache/coyote/http2/TestHttp2Section_6_5.java‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package org.apache.coyote.http2;
1818

19+
import java.net.SocketException;
1920
import java.net.SocketTimeoutException;
2021

2122
import org.junit.Assert;
@@ -48,12 +49,20 @@ public void testSettingsFrameEmptyAckFlood() throws Exception {
4849
readSimpleGetResponse();
4950
output.clearTrace();
5051

51-
// Unsolicited, empty SETTINGS ACK frames
52-
for (int i = 0; i < 100; i++) {
53-
sendSettings(0, true);
54-
}
52+
/*
53+
* Unsolicited, empty SETTINGS ACK frames. The server may close the connection before all of the frames (or the
54+
* following GET request) have been written so a write failure is not an error. The GOAWAY check below is what
55+
* determines the test result.
56+
*/
57+
try {
58+
for (int i = 0; i < 100; i++) {
59+
sendSettings(0, true);
60+
}
5561

56-
sendSimpleGetRequest(5);
62+
sendSimpleGetRequest(5);
63+
} catch (SocketException se) {
64+
// Expected if the server closed the connection early
65+
}
5766

5867
/*
5968
* Expect the server to close the connection with ENHANCE_YOUR_CALM. The response to the second GET request may

0 commit comments

Comments
 (0)