diff --git a/extensions/mutiny/deployment/src/test/java/io/quarkus/mutiny/deployment/test/MutinyTest.java b/extensions/mutiny/deployment/src/test/java/io/quarkus/mutiny/deployment/test/MutinyTest.java index b61959a5fc134..c94a0339f8d79 100644 --- a/extensions/mutiny/deployment/src/test/java/io/quarkus/mutiny/deployment/test/MutinyTest.java +++ b/extensions/mutiny/deployment/src/test/java/io/quarkus/mutiny/deployment/test/MutinyTest.java @@ -20,6 +20,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import io.quarkus.mutiny.runtime.MutinyInfrastructure; import io.quarkus.test.QuarkusUnitTest; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; @@ -91,7 +92,7 @@ public void testForbiddenUniBlocking() throws InterruptedException { throwable.set(err); } latch.countDown(); - }, "vertx-eventloop-thread-0").start(); + }, MutinyInfrastructure.VERTX_EVENT_LOOP_THREAD_PREFIX + "0").start(); Assertions.assertTrue(latch.await(5, TimeUnit.SECONDS)); Assertions.assertNull(item.get()); diff --git a/extensions/mutiny/runtime/src/main/java/io/quarkus/mutiny/runtime/MutinyInfrastructure.java b/extensions/mutiny/runtime/src/main/java/io/quarkus/mutiny/runtime/MutinyInfrastructure.java index a84a18093d972..1304b385f6c8b 100644 --- a/extensions/mutiny/runtime/src/main/java/io/quarkus/mutiny/runtime/MutinyInfrastructure.java +++ b/extensions/mutiny/runtime/src/main/java/io/quarkus/mutiny/runtime/MutinyInfrastructure.java @@ -12,6 +12,8 @@ @Recorder public class MutinyInfrastructure { + public static final String VERTX_EVENT_LOOP_THREAD_PREFIX = "vert.x-eventloop-thread-"; + public void configureMutinyInfrastructure(ExecutorService exec) { Infrastructure.setDefaultExecutor(exec); } @@ -36,7 +38,7 @@ public boolean getAsBoolean() { * calling from a Vert.x event-loop context / thread. */ String threadName = Thread.currentThread().getName(); - return !threadName.contains("vertx-eventloop-thread-"); + return !threadName.startsWith(VERTX_EVENT_LOOP_THREAD_PREFIX); } }); }