From ac6321861b3fa13412c34092ed7a0dc64cacc14b Mon Sep 17 00:00:00 2001 From: Yashwant Date: Wed, 4 Sep 2024 16:58:26 +0530 Subject: [PATCH] fixing vertx client test --- .../vertx/VertxClientInstrumentationPostTests.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/instrumentation/vertx/vertx-web-3.0/src/test/java/io/opentelemetry/javaagent/instrumentation/hypertrace/vertx/VertxClientInstrumentationPostTests.java b/instrumentation/vertx/vertx-web-3.0/src/test/java/io/opentelemetry/javaagent/instrumentation/hypertrace/vertx/VertxClientInstrumentationPostTests.java index 737e7a81..1b504c7d 100644 --- a/instrumentation/vertx/vertx-web-3.0/src/test/java/io/opentelemetry/javaagent/instrumentation/hypertrace/vertx/VertxClientInstrumentationPostTests.java +++ b/instrumentation/vertx/vertx-web-3.0/src/test/java/io/opentelemetry/javaagent/instrumentation/hypertrace/vertx/VertxClientInstrumentationPostTests.java @@ -109,7 +109,15 @@ public void postJson_write_end_string() throws TimeoutException, InterruptedExce TEST_WRITER.waitForTraces(1); List> traces = - TEST_WRITER.waitForSpans(1, span -> span.getKind().equals(Span.SpanKind.SPAN_KIND_SERVER)); + TEST_WRITER.waitForSpans( + 1, + span -> + !span.getKind().equals(Span.SpanKind.SPAN_KIND_CLIENT) + || span.getAttributesList().stream() + .noneMatch( + keyValue -> + keyValue.getKey().equals("http.url") + && keyValue.getValue().getStringValue().contains("/echo"))); Assertions.assertEquals(1, traces.size(), String.format("was: %d", traces.size())); Span clientSpan = traces.get(0).get(0); Assertions.assertEquals(