From 42890fd5fdab3921cb8db0f87ab19ff2637c1cb5 Mon Sep 17 00:00:00 2001 From: am312 Date: Wed, 28 Feb 2024 15:56:07 -0500 Subject: [PATCH] revert test files --- .../groovy/ExecutorInstrumentationTest.groovy | 26 +++---------------- .../NettyExecutorInstrumentationTest.groovy | 4 +-- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/dd-java-agent/instrumentation/java-concurrent/src/test/groovy/ExecutorInstrumentationTest.groovy b/dd-java-agent/instrumentation/java-concurrent/src/test/groovy/ExecutorInstrumentationTest.groovy index d3b2f6ab6b5..b15831402fd 100644 --- a/dd-java-agent/instrumentation/java-concurrent/src/test/groovy/ExecutorInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/java-concurrent/src/test/groovy/ExecutorInstrumentationTest.groovy @@ -6,7 +6,6 @@ import datadog.trace.bootstrap.instrumentation.java.concurrent.RunnableWrapper import datadog.trace.core.DDSpan import org.apache.tomcat.util.threads.TaskQueue import spock.lang.Shared -import spock.lang.Unroll import java.lang.reflect.InvocationTargetException import java.util.concurrent.ArrayBlockingQueue @@ -68,9 +67,7 @@ abstract class ExecutorInstrumentationTest extends AgentTestRunner { injectSysConfig("trace.thread-pool-executors.exclude", "ExecutorInstrumentationTest\$ToBeIgnoredExecutor") } - //@Unroll - def "TEST1"() { - //def "#poolName '#name' propagates"() { + def "#poolName '#name' propagates"() { setup: assumeTrue(poolImpl != null) // skip for Java 7 CompletableFuture, non-Linux Netty EPoll def pool = poolImpl @@ -147,20 +144,6 @@ abstract class ExecutorInstrumentationTest extends AgentTestRunner { "invokeAny" | invokeAny | new ForkJoinPool() "invokeAny with timeout" | invokeAnyTimeout | new ForkJoinPool() - // ForkJoinPool has additional set of method overloads for ForkJoinTask to deal with - "execute Runnable" | executeRunnable | new ForkJoinPool() - "execute ForkJoinTask" | executeForkJoinTask | new ForkJoinPool() - "submit Runnable" | submitRunnable | new ForkJoinPool() - "submit Callable" | submitCallable | new ForkJoinPool() - "submit Runnable ECS" | submitRunnableExecutorCompletionService | new ExecutorCompletionService<>(new ForkJoinPool()) - "submit Callable ECS" | submitCallable | new ExecutorCompletionService<>(new ForkJoinPool()) - "submit ForkJoinTask" | submitForkJoinTask | new ForkJoinPool() - "invoke ForkJoinTask" | invokeForkJoinTask | new ForkJoinPool() - "invokeAll" | invokeAll | new ForkJoinPool() - "invokeAll with timeout" | invokeAllTimeout | new ForkJoinPool() - "invokeAny" | invokeAny | new ForkJoinPool() - "invokeAny with timeout" | invokeAnyTimeout | new ForkJoinPool() - // CustomThreadPoolExecutor would normally be disabled except enabled above. "execute Runnable" | executeRunnable | new CustomThreadPoolExecutor() "submit Runnable" | submitRunnable | new CustomThreadPoolExecutor() @@ -172,6 +155,7 @@ abstract class ExecutorInstrumentationTest extends AgentTestRunner { "invokeAny" | invokeAny | new CustomThreadPoolExecutor() "invokeAny with timeout" | invokeAnyTimeout | new CustomThreadPoolExecutor() + "execute Runnable" | executeRunnable | new TypeAwareThreadPoolExecutor() "submit Runnable" | submitRunnable | new TypeAwareThreadPoolExecutor() "submit Callable" | submitCallable | new TypeAwareThreadPoolExecutor() @@ -202,6 +186,7 @@ abstract class ExecutorInstrumentationTest extends AgentTestRunner { "invokeAny" | invokeAny | Executors.unconfigurableExecutorService(Executors.newSingleThreadExecutor()) "invokeAny with timeout" | invokeAnyTimeout | Executors.unconfigurableExecutorService(Executors.newSingleThreadExecutor()) + "execute Runnable" | executeRunnable | Executors.unconfigurableScheduledExecutorService(Executors.newSingleThreadScheduledExecutor()) "submit Runnable" | submitRunnable | Executors.unconfigurableScheduledExecutorService(Executors.newSingleThreadScheduledExecutor()) "submit Callable" | submitCallable | Executors.unconfigurableScheduledExecutorService(Executors.newSingleThreadScheduledExecutor()) @@ -250,10 +235,9 @@ abstract class ExecutorInstrumentationTest extends AgentTestRunner { "schedule Runnable" | scheduleRunnable | MoreExecutors.listeningDecorator(Executors.newSingleThreadScheduledExecutor()) "schedule Callable" | scheduleCallable | MoreExecutors.listeningDecorator(Executors.newSingleThreadScheduledExecutor()) // spotless:on - //poolName = poolImpl == null ? "null poolImpl" : poolImpl.class.simpleName + poolName = poolImpl.class.simpleName } - @Unroll def "#poolName '#name' doesn't propagate"() { setup: def pool = poolImpl @@ -368,7 +352,6 @@ abstract class ExecutorInstrumentationTest extends AgentTestRunner { } } - @Unroll def "#poolName '#name' wraps"() { setup: def pool = poolImpl @@ -406,7 +389,6 @@ abstract class ExecutorInstrumentationTest extends AgentTestRunner { poolName = poolImpl.class.simpleName } - @Unroll def "#poolName '#name' reports after canceled jobs"() { setup: assumeTrue(poolImpl != null) // skip for non-Linux Netty EPoll diff --git a/dd-java-agent/instrumentation/java-concurrent/src/test/groovy/NettyExecutorInstrumentationTest.groovy b/dd-java-agent/instrumentation/java-concurrent/src/test/groovy/NettyExecutorInstrumentationTest.groovy index aa3a5b5d7b4..4ccbb001ace 100644 --- a/dd-java-agent/instrumentation/java-concurrent/src/test/groovy/NettyExecutorInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/java-concurrent/src/test/groovy/NettyExecutorInstrumentationTest.groovy @@ -195,7 +195,7 @@ class NettyExecutorInstrumentationTest extends AgentTestRunner { "schedule Runnable" | scheduleRunnable | localEventLoopGroup "schedule Callable" | scheduleCallable | localEventLoopGroup - // poolName = poolImpl.class.simpleName + poolName = poolImpl.class.simpleName } def "#poolName '#name' reports after canceled jobs"() { @@ -274,7 +274,7 @@ class NettyExecutorInstrumentationTest extends AgentTestRunner { "schedule Runnable" | scheduleRunnable | localEventLoopGroup.next() "schedule Callable" | scheduleCallable | localEventLoopGroup.next() - poolName = poolImpl == null ? "null" : poolImpl.class.simpleName + poolName = poolImpl.class.simpleName } def epollExecutor() {