Add junit test timeotut
@@ -16,7 +16,11 @@ import io.opentelemetry.instrumentation.testing.util.TelemetryDataUtil
import io.opentelemetry.instrumentation.testing.util.ThrowingSupplier
import io.opentelemetry.sdk.metrics.data.MetricData
import io.opentelemetry.sdk.trace.data.SpanData
+import java.util.concurrent.TimeUnit
+import org.junit.Rule
+import org.junit.rules.Timeout
import spock.lang.Specification
+
/**
* Base class for test specifications that are shared between instrumentation libraries and agent.
* The methods in this class are implemented by {@link AgentTestTrait} and
@@ -25,6 +29,9 @@ import spock.lang.Specification
abstract class InstrumentationSpecification extends Specification {
abstract InstrumentationTestRunner testRunner()
+ @Rule
+ public Timeout testTimeout = new Timeout(10, TimeUnit.MINUTES)
+
def setupSpec() {
testRunner().beforeTestClass()
}
