Skip to content

Commit 71ffb44

Browse files
committed
Remove WebClient's in-memory buffer size limit for endpoint tests
Previously, the endpoints' responses could occasionally exceed WebClient's in-memory buffer limt, for example if the threads endpoint was reporting a large number of threads or the threads had large stacks. This commit disables WebClient's in-memory buffer size limit so that the tests passing is not dependent on the size of the endpoints' responses. Closes gh-22743
1 parent 2238b0d commit 71ffb44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ private WebTestClient createClient(AssertableWebApplicationContext context) {
166166
int port = context.getSourceApplicationContext(ServletWebServerApplicationContext.class).getWebServer()
167167
.getPort();
168168
ExchangeStrategies exchangeStrategies = ExchangeStrategies.builder()
169-
.codecs((configurer) -> configurer.defaultCodecs().maxInMemorySize(512 * 1024)).build();
169+
.codecs((configurer) -> configurer.defaultCodecs().maxInMemorySize(-1)).build();
170170
return WebTestClient.bindToServer().baseUrl("http://localhost:" + port).exchangeStrategies(exchangeStrategies)
171171
.build();
172172
}

0 commit comments

Comments
 (0)