From fc1ed0b340c7784095cbb33eb4f3ed2f6095ea86 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 23 Oct 2024 10:14:32 -0700 Subject: [PATCH] Increase timeout in ZipkinWebClientSenderTests --- .../tracing/zipkin/ZipkinWebClientSenderTests.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinWebClientSenderTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinWebClientSenderTests.java index 9bce4b83d147..71ad42aa5457 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinWebClientSenderTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinWebClientSenderTests.java @@ -51,6 +51,8 @@ @SuppressWarnings({ "deprecation", "removal" }) class ZipkinWebClientSenderTests extends ZipkinHttpSenderTests { + private static final Duration TIMEOUT = Duration.ofSeconds(30); + private static ClearableDispatcher dispatcher; private static MockWebServer mockBackEnd; @@ -81,7 +83,7 @@ void beforeEach() { @Override BytesMessageSender createSender() { - return createSender(Encoding.JSON, Duration.ofSeconds(10)); + return createSender(Encoding.JSON, TIMEOUT); } ZipkinWebClientSender createSender(Encoding encoding, Duration timeout) { @@ -110,7 +112,7 @@ void sendShouldSendSpansToZipkin() throws IOException, InterruptedException { void sendShouldSendSpansToZipkinInProto3() throws IOException, InterruptedException { mockBackEnd.enqueue(new MockResponse()); List encodedSpans = List.of(toByteArray("span1"), toByteArray("span2")); - try (BytesMessageSender sender = createSender(Encoding.PROTO3, Duration.ofSeconds(10))) { + try (BytesMessageSender sender = createSender(Encoding.PROTO3, TIMEOUT)) { sender.send(encodedSpans); } requestAssertions((request) -> { @@ -125,8 +127,7 @@ void sendUsesDynamicEndpoint() throws Exception { mockBackEnd.enqueue(new MockResponse()); mockBackEnd.enqueue(new MockResponse()); try (HttpEndpointSupplier httpEndpointSupplier = new TestHttpEndpointSupplier(ZIPKIN_URL)) { - try (BytesMessageSender sender = createSender((endpoint) -> httpEndpointSupplier, Encoding.JSON, - Duration.ofSeconds(10))) { + try (BytesMessageSender sender = createSender((endpoint) -> httpEndpointSupplier, Encoding.JSON, TIMEOUT)) { sender.send(Collections.emptyList()); sender.send(Collections.emptyList()); }