From f6766c7433d943a1fe3cfdd2f57fbebaa8330878 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Sun, 23 Oct 2022 11:48:03 -0700 Subject: [PATCH] Remove unused test option (#6950) --- .../test/base/HttpClientTest.groovy | 27 +++---------------- .../junit/http/AbstractHttpClientTest.java | 18 ------------- .../junit/http/HttpClientTestOptions.java | 14 ---------- 3 files changed, 3 insertions(+), 56 deletions(-) diff --git a/testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpClientTest.groovy b/testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpClientTest.groovy index 1729cb5a3fa2..3749889afd07 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpClientTest.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpClientTest.groovy @@ -5,9 +5,6 @@ package io.opentelemetry.instrumentation.test.base -import static org.junit.jupiter.api.Assumptions.assumeTrue -import static org.junit.jupiter.api.Assumptions.assumeFalse - import io.opentelemetry.api.common.AttributeKey import io.opentelemetry.api.trace.SpanId import io.opentelemetry.instrumentation.test.InstrumentationSpecification @@ -22,6 +19,9 @@ import spock.lang.Requires import spock.lang.Shared import spock.lang.Unroll +import static org.junit.jupiter.api.Assumptions.assumeFalse +import static org.junit.jupiter.api.Assumptions.assumeTrue + @Unroll abstract class HttpClientTest extends InstrumentationSpecification { protected static final BODY_METHODS = ["POST", "PUT"] @@ -200,16 +200,6 @@ abstract class HttpClientTest extends InstrumentationSpecification { return HttpClientTest.this.testHttps() } - @Override - protected boolean testCausality() { - return HttpClientTest.this.testCausality() - } - - @Override - protected boolean testCausalityWithCallback() { - return HttpClientTest.this.testCausalityWithCallback() - } - @Override protected boolean testCallback() { return HttpClientTest.this.testCallback() @@ -402,14 +392,11 @@ abstract class HttpClientTest extends InstrumentationSpecification { * propagate trace context. */ def "high concurrency test"() { - assumeTrue(testCausality()) expect: junitTest.highConcurrency() } def "high concurrency test with callback"() { - assumeTrue(testCausality()) - assumeTrue(testCausalityWithCallback()) assumeTrue(testCallback()) assumeTrue(testCallbackWithParent()) expect: @@ -493,14 +480,6 @@ abstract class HttpClientTest extends InstrumentationSpecification { true } - boolean testCausality() { - true - } - - boolean testCausalityWithCallback() { - true - } - boolean testCallback() { return true } diff --git a/testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/http/AbstractHttpClientTest.java b/testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/http/AbstractHttpClientTest.java index f0a94b5461be..2166f631a916 100644 --- a/testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/http/AbstractHttpClientTest.java +++ b/testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/http/AbstractHttpClientTest.java @@ -183,12 +183,6 @@ void setupOptions() { if (!testHttps()) { options.disableTestHttps(); } - if (!testCausality()) { - options.disableTestCausality(); - } - if (!testCausalityWithCallback()) { - options.disableTestCausalityWithCallback(); - } if (!testCallback()) { options.disableTestCallback(); } @@ -704,8 +698,6 @@ void httpsRequest() throws Exception { */ @Test void highConcurrency() { - assumeTrue(options.testCausality); - int count = 50; String method = "GET"; URI uri = resolveAddress("/success"); @@ -777,8 +769,6 @@ void highConcurrency() { @Test void highConcurrencyWithCallback() { - assumeTrue(options.testCausality); - assumeTrue(options.testCausalityWithCallback); assumeTrue(options.testCallback); assumeTrue(options.testCallbackWithParent); @@ -1121,14 +1111,6 @@ protected boolean testHttps() { return true; } - protected boolean testCausality() { - return true; - } - - protected boolean testCausalityWithCallback() { - return true; - } - protected boolean testCallback() { return true; } diff --git a/testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/http/HttpClientTestOptions.java b/testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/http/HttpClientTestOptions.java index 4b2a2e1769fc..edee9178a010 100644 --- a/testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/http/HttpClientTestOptions.java +++ b/testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/http/HttpClientTestOptions.java @@ -53,8 +53,6 @@ public final class HttpClientTestOptions { boolean testReadTimeout = false; boolean testRemoteConnection = true; boolean testHttps = true; - boolean testCausality = true; - boolean testCausalityWithCallback = true; boolean testCallback = true; boolean testCallbackWithParent = true; boolean testCallbackWithImplicitParent = false; @@ -156,18 +154,6 @@ public HttpClientTestOptions disableTestHttps() { return this; } - @CanIgnoreReturnValue - public HttpClientTestOptions disableTestCausality() { - testCausality = false; - return this; - } - - @CanIgnoreReturnValue - public HttpClientTestOptions disableTestCausalityWithCallback() { - testCausalityWithCallback = false; - return this; - } - @CanIgnoreReturnValue public HttpClientTestOptions disableTestCallback() { testCallback = false;