Commit 5475f106 authored by Andy Wilkinson's avatar Andy Wilkinson

Remove WebClient's in-memory buffer size limit for endpoint tests

Previously, the thread dump endpoint's response could exceed
WebClient's in-memory buffer limt when there were a large number of
threads or the threads had large stacks.

This commit disables WebClient's in-memory buffer size limit so that
the test passing is not dependent on the number of active threads and
their stack sizes.

Closes gh-22101
parent b2730370
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -192,7 +192,8 @@ class WebEndpointTestInvocationContextProvider implements TestTemplateInvocation ...@@ -192,7 +192,8 @@ class WebEndpointTestInvocationContextProvider implements TestTemplateInvocation
DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory( DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(
"http://localhost:" + determinePort()); "http://localhost:" + determinePort());
uriBuilderFactory.setEncodingMode(EncodingMode.NONE); uriBuilderFactory.setEncodingMode(EncodingMode.NONE);
return WebTestClient.bindToServer().uriBuilderFactory(uriBuilderFactory).responseTimeout(TIMEOUT).build(); return WebTestClient.bindToServer().uriBuilderFactory(uriBuilderFactory).responseTimeout(TIMEOUT)
.codecs((codecs) -> codecs.defaultCodecs().maxInMemorySize(-1)).build();
} }
private int determinePort() { private int determinePort() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment