diff --git a/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/completable/OffloadingTest.java b/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/completable/OffloadingTest.java index 93c9ad6399..ce75bef282 100644 --- a/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/completable/OffloadingTest.java +++ b/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/completable/OffloadingTest.java @@ -143,8 +143,8 @@ enum OffloadCase { } } - @ParameterizedTest - @EnumSource(OffloadingTest.OffloadCase.class) + @ParameterizedTest(name = "{displayName} [{index}]: case={0}") + @EnumSource(OffloadCase.class) void testOffloading(OffloadCase offloadCase) throws InterruptedException { int offloads = testOffloading(offloadCase.offloadOperator, offloadCase.terminal); assertThat("Unexpected offloads: " + offloadCase.expectedOffloads, diff --git a/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/internal/AbstractOffloadingTest.java b/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/internal/AbstractOffloadingTest.java index 7d21b19c0d..3b1f3a56fc 100644 --- a/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/internal/AbstractOffloadingTest.java +++ b/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/internal/AbstractOffloadingTest.java @@ -18,6 +18,7 @@ import io.servicetalk.concurrent.api.AsyncContext; import io.servicetalk.concurrent.api.Executor; import io.servicetalk.concurrent.api.ExecutorExtension; +import io.servicetalk.concurrent.api.Executors; import io.servicetalk.concurrent.api.TestExecutor; import io.servicetalk.concurrent.internal.DeliberateException; import io.servicetalk.context.api.ContextMap; @@ -28,7 +29,6 @@ import org.slf4j.LoggerFactory; import static io.servicetalk.concurrent.api.ExecutorExtension.withCachedExecutor; -import static io.servicetalk.concurrent.api.Executors.immediate; import static io.servicetalk.context.api.ContextMap.Key.newKey; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; @@ -80,9 +80,10 @@ protected enum TerminalOperation { protected static final Matcher OFFLOAD_EXECUTOR = startsWith("TestExecutor"); @RegisterExtension - public static final ExecutorExtension APP_EXECUTOR_EXT = APP_ISOLATION ? + public static final ExecutorExtension APP_EXECUTOR_EXT = (APP_ISOLATION ? withCachedExecutor(APP_EXECUTOR_PREFIX) : - ExecutorExtension.withExecutor(() -> immediate()).setClassLevel(true); + ExecutorExtension.withExecutor(Executors::immediate)) + .setClassLevel(true); @RegisterExtension public final ExecutorExtension testExecutor = ExecutorExtension.withTestExecutor(); diff --git a/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/publisher/OffloadingTest.java b/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/publisher/OffloadingTest.java index 21ec7809f8..9d391f13e1 100644 --- a/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/publisher/OffloadingTest.java +++ b/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/publisher/OffloadingTest.java @@ -20,8 +20,6 @@ import org.hamcrest.CoreMatchers; import org.hamcrest.Matcher; -import org.junit.jupiter.api.parallel.Execution; -import org.junit.jupiter.api.parallel.ExecutionMode; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; @@ -50,7 +48,6 @@ import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; -@Execution(ExecutionMode.CONCURRENT) class OffloadingTest extends AbstractPublisherOffloadingTest { enum OffloadCase { @@ -190,7 +187,7 @@ enum OffloadCase { } } - @ParameterizedTest + @ParameterizedTest(name = "{displayName} [{index}]: case={0}") @EnumSource(OffloadCase.class) void testOffloading(OffloadCase offloadCase) throws InterruptedException { int offloads = testOffloading(offloadCase.offloadOperator, offloadCase.terminal); diff --git a/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/single/OffloadingTest.java b/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/single/OffloadingTest.java index d6737db86c..66cbbb025b 100644 --- a/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/single/OffloadingTest.java +++ b/servicetalk-concurrent-api-internal/src/test/java/io/servicetalk/concurrent/api/single/OffloadingTest.java @@ -142,9 +142,9 @@ enum OffloadCase { } } - @ParameterizedTest - @EnumSource(OffloadingTest.OffloadCase.class) - void testOffloading(OffloadingTest.OffloadCase offloadCase) throws InterruptedException { + @ParameterizedTest(name = "{displayName} [{index}]: case={0}") + @EnumSource(OffloadCase.class) + void testOffloading(OffloadCase offloadCase) throws InterruptedException { int offloads = testOffloading(offloadCase.offloadOperator, offloadCase.terminal); assertThat("Unexpected offloads: " + offloadCase.expectedOffloads, offloads, CoreMatchers.is(offloadCase.offloadsExpected));