From 71ffb44a3c6d2043cc491bb576518116015c5744 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 5 Aug 2020 17:37:44 +0100 Subject: [PATCH] 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 --- .../integrationtest/WebMvcEndpointExposureIntegrationTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java index 268391639a..61dd70d553 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java @@ -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(); }