Skip to content

Commit

Permalink
test: improve http client failure test performance (disable retry)
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa committed Dec 16, 2024
1 parent a09d1c1 commit 54932f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package io.fabric8.kubernetes.client.http;

import io.fabric8.kubernetes.client.RequestConfigBuilder;
import io.fabric8.mockwebserver.DefaultMockServer;
import io.fabric8.mockwebserver.http.RecordedRequest;
import org.junit.jupiter.api.AfterAll;
Expand Down Expand Up @@ -161,7 +162,8 @@ public void expectContinue() throws Exception {
public void expectFailure() throws IOException, URISyntaxException {
try (final ServerSocket serverSocket = new ServerSocket(0)) {

try (HttpClient client = getHttpClientFactory().newBuilder().build()) {
try (HttpClient client = getHttpClientFactory().newBuilder()
.tag(new RequestConfigBuilder().withRequestRetryBackoffLimit(0).build()).build()) {
final URI uri = uriForPath(serverSocket, "/post-failing");
serverSocket.close();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package io.fabric8.kubernetes.client.http;

import io.fabric8.kubernetes.client.RequestConfigBuilder;
import io.fabric8.mockwebserver.DefaultMockServer;
import io.fabric8.mockwebserver.http.RecordedRequest;
import org.junit.jupiter.api.AfterAll;
Expand Down Expand Up @@ -97,7 +98,8 @@ public void putInputStreamBody() throws Exception {
public void expectFailure() throws IOException, URISyntaxException {
try (final ServerSocket serverSocket = new ServerSocket(0)) {

try (HttpClient client = getHttpClientFactory().newBuilder().build()) {
try (HttpClient client = getHttpClientFactory().newBuilder()
.tag(new RequestConfigBuilder().withRequestRetryBackoffLimit(0).build()).build()) {
final URI uri = uriForPath(serverSocket, "/put-failing");
serverSocket.close();

Expand Down

0 comments on commit 54932f5

Please sign in to comment.