From deed4211eef9889a940202f1e1730591a3443279 Mon Sep 17 00:00:00 2001 From: Julien Ponge Date: Wed, 21 Feb 2024 17:05:03 +0100 Subject: [PATCH] test: reproducer for issue #1520 --- .../io/smallrye/mutiny/BugReproducersTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/implementation/src/test/java/io/smallrye/mutiny/BugReproducersTest.java b/implementation/src/test/java/io/smallrye/mutiny/BugReproducersTest.java index f5f6f729a..b841c1afd 100644 --- a/implementation/src/test/java/io/smallrye/mutiny/BugReproducersTest.java +++ b/implementation/src/test/java/io/smallrye/mutiny/BugReproducersTest.java @@ -4,6 +4,7 @@ import static org.awaitility.Awaitility.await; import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import java.time.Duration; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutorService; @@ -94,4 +95,17 @@ void reproducer_quarkus_21528() { Uni.join().first(asList).withItem(); } + + @Test + void reproducer_1520() { + // From https://github.com/smallrye/smallrye-mutiny/issues/1520 and + // to address https://github.com/quarkusio/quarkus/issues/34613 + AtomicInteger counter = new AtomicInteger(); + Multi.createFrom().iterable(List.of("aa", "bb", "cc")) + .collect().asList() + .onTermination().invoke(counter::incrementAndGet) + .onFailure().retry().withBackOff(Duration.ofSeconds(1)).atMost(2) + .await().atMost(Duration.ofSeconds(5)); + assertThat(counter).hasValue(1); + } }