Skip to content

Commit fdd744d

Browse files
janhavisclaude
andcommitted
Close response body in redirect and blocking tests to prevent HTTP/2 flow control issues
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 322715f commit fdd744d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,7 @@ abstract class HttpServerTest<SERVER> extends WithHttpServer<SERVER> {
11701170
}
11711171

11721172
response.body().contentLength() < 1 || redirectHasBody()
1173+
response.close()
11731174

11741175
and:
11751176
assertTraces(1) {
@@ -1840,6 +1841,7 @@ abstract class HttpServerTest<SERVER> extends WithHttpServer<SERVER> {
18401841
response.code() == 301
18411842
response.header('location') == 'https://www.google.com/'
18421843
!handlerRan
1844+
response.close()
18431845

18441846
when:
18451847
TEST_WRITER.waitForTraces(1)
@@ -2121,6 +2123,7 @@ abstract class HttpServerTest<SERVER> extends WithHttpServer<SERVER> {
21212123
}
21222124
response.code() == 301
21232125
response.header("Location") == 'https://www.google.com/'
2126+
response.close()
21242127
TEST_WRITER.waitForTraces(1)
21252128
def trace = TEST_WRITER.get(0)
21262129

0 commit comments

Comments
 (0)