Add junit test timeotut (#3850)

This commit is contained in:
Lauri Tulmin 2021-08-16 20:11:09 +03:00 committed by GitHub
parent 722fbc1d57
commit 430f1cb561
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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()
}