From b37b2c6f8ae8b7c6e4a744f89cf7d5095564734b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20=C3=89pardaud?= Date: Fri, 7 Jun 2024 16:57:23 +0200 Subject: [PATCH] Use latest SR/CP Fixes #40852 (cherry picked from commit 0dc312b77f4b23131b72b89e59e92b97650fdd6c) --- bom/application/pom.xml | 2 +- .../test/mutiny/MutinyContextEndpoint.java | 18 ++++++++++++++++++ .../mutiny/MutinyContextPropagationTest.java | 6 ++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 92da07624a0a8..b7aa94cc0730e 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -58,7 +58,7 @@ 2.8.4 6.3.0 4.5.2 - 2.1.0 + 2.1.2 1.0.13 3.0.1 3.12.0 diff --git a/integration-tests/smallrye-context-propagation/src/test/java/io/quarkus/context/test/mutiny/MutinyContextEndpoint.java b/integration-tests/smallrye-context-propagation/src/test/java/io/quarkus/context/test/mutiny/MutinyContextEndpoint.java index 26b82ed2877cb..38af7757bca52 100644 --- a/integration-tests/smallrye-context-propagation/src/test/java/io/quarkus/context/test/mutiny/MutinyContextEndpoint.java +++ b/integration-tests/smallrye-context-propagation/src/test/java/io/quarkus/context/test/mutiny/MutinyContextEndpoint.java @@ -1,6 +1,7 @@ package io.quarkus.context.test.mutiny; import java.net.MalformedURLException; +import java.time.Duration; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -461,4 +462,21 @@ public Flow.Publisher transactionPropagationWithMulti2() { Assertions.assertEquals(2, Person.deleteAll()); return ret; } + + @GET + @Path("/bug40852") + public String bug40852() { + var futureW = Uni + .createFrom() + .item("item") + .onItem() + .delayIt() + .by(Duration.ofMillis(100)) + .subscribeAsCompletionStage(); + + futureW.whenComplete((result, error) -> { + Assertions.assertEquals(true, futureW.isDone()); + }).join(); + return "OK"; + } } diff --git a/integration-tests/smallrye-context-propagation/src/test/java/io/quarkus/context/test/mutiny/MutinyContextPropagationTest.java b/integration-tests/smallrye-context-propagation/src/test/java/io/quarkus/context/test/mutiny/MutinyContextPropagationTest.java index d8df31f05ed58..5da3db6437412 100644 --- a/integration-tests/smallrye-context-propagation/src/test/java/io/quarkus/context/test/mutiny/MutinyContextPropagationTest.java +++ b/integration-tests/smallrye-context-propagation/src/test/java/io/quarkus/context/test/mutiny/MutinyContextPropagationTest.java @@ -156,6 +156,12 @@ public void testTransactionContextPropagationMulti() { .statusCode(Response.Status.OK.getStatusCode())); } + @Test + public void testContextPropagationBug40852() { + RestAssured.when().get("/mutiny-context/bug40852").then() + .statusCode(Response.Status.OK.getStatusCode()); + } + private void awaitState(ThrowingRunnable task) { Awaitility.await().atMost(5, TimeUnit.SECONDS) .pollInterval(100, TimeUnit.MILLISECONDS)