From 2b9361828850dd3096ec91fd37810052ac5d891e Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 14 Aug 2024 10:06:57 +0200 Subject: [PATCH] Polishing. Reduce probability for flakiness. See #1493. --- spring-data-cassandra-distribution/pom.xml | 1 - .../cassandra/observability/ReactiveIntegrationTests.java | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/spring-data-cassandra-distribution/pom.xml b/spring-data-cassandra-distribution/pom.xml index b64d822bc..0b64b3254 100644 --- a/spring-data-cassandra-distribution/pom.xml +++ b/spring-data-cassandra-distribution/pom.xml @@ -38,7 +38,6 @@ - diff --git a/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/observability/ReactiveIntegrationTests.java b/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/observability/ReactiveIntegrationTests.java index 38b5e2003..9ec73ac40 100644 --- a/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/observability/ReactiveIntegrationTests.java +++ b/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/observability/ReactiveIntegrationTests.java @@ -15,18 +15,20 @@ */ package org.springframework.data.cassandra.observability; +import static org.assertj.core.api.Assertions.*; + import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.simple.SimpleMeterRegistry; import io.micrometer.observation.Observation; import io.micrometer.observation.ObservationRegistry; import io.micrometer.observation.contextpropagation.ObservationThreadLocalAccessor; import io.micrometer.tracing.test.SampleTestRunner; -import static org.assertj.core.api.Assertions.*; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; import reactor.util.context.Context; import org.junit.jupiter.api.extension.ExtendWith; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.cassandra.ReactiveResultSet; import org.springframework.data.cassandra.ReactiveSession; @@ -88,7 +90,7 @@ public SampleTestRunnerConsumer yourCode() { System.out.println(((SimpleMeterRegistry) meterRegistry).getMetersAsString()); - assertThat(tracer.getFinishedSpans().size()).isGreaterThanOrEqualTo(7); + assertThat(tracer.getFinishedSpans()).hasSizeGreaterThanOrEqualTo(6); }; } }