Increase timeout in ZipkinWebClientSenderTests

This commit is contained in:
Phillip Webb 2024-10-23 10:14:32 -07:00
parent 9210b3b8e9
commit fc1ed0b340
1 changed files with 5 additions and 4 deletions

View File

@ -51,6 +51,8 @@ import static org.assertj.core.api.Assertions.assertThatException;
@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 @@ class ZipkinWebClientSenderTests extends ZipkinHttpSenderTests {
@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 @@ class ZipkinWebClientSenderTests extends ZipkinHttpSenderTests {
void sendShouldSendSpansToZipkinInProto3() throws IOException, InterruptedException {
mockBackEnd.enqueue(new MockResponse());
List<byte[]> 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 @@ class ZipkinWebClientSenderTests extends ZipkinHttpSenderTests {
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());
}