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
This commit is contained in:
Andy Wilkinson 2020-08-05 17:37:44 +01:00
parent 2238b0d797
commit 71ffb44a3c

View File

@ -166,7 +166,7 @@ class WebMvcEndpointExposureIntegrationTests {
int port = context.getSourceApplicationContext(ServletWebServerApplicationContext.class).getWebServer()
.getPort();
ExchangeStrategies exchangeStrategies = ExchangeStrategies.builder()
.codecs((configurer) -> configurer.defaultCodecs().maxInMemorySize(512 * 1024)).build();
.codecs((configurer) -> configurer.defaultCodecs().maxInMemorySize(-1)).build();
return WebTestClient.bindToServer().baseUrl("http://localhost:" + port).exchangeStrategies(exchangeStrategies)
.build();
}