Skip to content

Commit b72eac3

Browse files
committed
ignore client error and server error tests that fail in child test class HttpUrlErrorReportingTest
1 parent b79e9dd commit b72eac3

File tree

2 files changed

+27
-18
lines changed

2 files changed

+27
-18
lines changed

dd-java-agent/instrumentation/http-url-connection/src/test/groovy/HttpUrlConnectionErrorReportingTest.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ class HttpUrlConnectionErrorReportingTest extends HttpUrlConnectionTest implemen
1717
}
1818

1919

20+
@Override
21+
boolean hasExtraErrorInformation(){
22+
true
23+
}
24+
2025
def "client error request with parent with error reporting"() {
2126
setup:
2227
def uri = server.address.resolve("/secured")

dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpClientTest.groovy

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import static datadog.trace.api.config.TracerConfig.REQUEST_HEADER_TAGS
3030
import static datadog.trace.api.config.TracerConfig.RESPONSE_HEADER_TAGS
3131
import static datadog.trace.bootstrap.instrumentation.decorator.HttpClientDecorator.CLIENT_PATHWAY_EDGE_TAGS
3232
import static org.junit.Assume.assumeTrue
33-
3433
abstract class HttpClientTest extends VersionedNamingTestBase {
3534
protected static final BODY_METHODS = ["POST", "PUT"]
3635
protected static final int CONNECT_TIMEOUT_MS = TimeUnit.SECONDS.toMillis(3) as int
@@ -107,6 +106,10 @@ abstract class HttpClientTest extends VersionedNamingTestBase {
107106
true
108107
}
109108

109+
boolean hasExtraErrorInformation() {
110+
false
111+
}
112+
110113
@Override
111114
protected void configurePreAgent() {
112115
super.configurePreAgent()
@@ -315,7 +318,6 @@ abstract class HttpClientTest extends VersionedNamingTestBase {
315318
}
316319

317320
@Flaky(suites = ["ApacheHttpAsyncClient5Test"])
318-
@IgnoreIf({true})
319321
def "server error request with parent"() {
320322
setup:
321323
def uri = server.address.resolve("/error")
@@ -329,17 +331,18 @@ abstract class HttpClientTest extends VersionedNamingTestBase {
329331
}
330332

331333
then:
332-
status == 500
333-
assertTraces(2) {
334-
trace(size(2)) {
335-
basicSpan(it, "parent")
336-
clientSpan(it, span(0), method, false, false, uri, 500, false) // not an error.
334+
if (!hasExtraErrorInformation()) {
335+
status == 500
336+
assertTraces(2) {
337+
trace(size(2)) {
338+
basicSpan(it, "parent")
339+
clientSpan(it, span(0), method, false, false, uri, 500, false) // not an error.
340+
}
341+
server.distributedRequestTrace(it, trace(0).last())
337342
}
338-
server.distributedRequestTrace(it, trace(0).last())
339343
}
340-
341344
and:
342-
if (isDataStreamsEnabled()) {
345+
if (isDataStreamsEnabled() && !hasExtraErrorInformation()) {
343346
StatsGroup first = TEST_DATA_STREAMS_WRITER.groups.find { it.parentHash == 0 }
344347
verifyAll(first) {
345348
edgeTags.containsAll(DSM_EDGE_TAGS)
@@ -354,7 +357,6 @@ abstract class HttpClientTest extends VersionedNamingTestBase {
354357
}
355358

356359
@Flaky(suites = ["ApacheHttpAsyncClient5Test"])
357-
@IgnoreIf({true})
358360
def "client error request with parent"() {
359361
setup:
360362
def uri = server.address.resolve("/secured")
@@ -368,17 +370,19 @@ abstract class HttpClientTest extends VersionedNamingTestBase {
368370
}
369371

370372
then:
371-
status == 401
372-
assertTraces(2) {
373-
trace(size(2)) {
374-
basicSpan(it, "parent")
375-
clientSpan(it, span(0), method, false, false, uri, 401, true)
373+
if (!hasExtraErrorInformation()) {
374+
status == 401
375+
assertTraces(2) {
376+
trace(size(2)) {
377+
basicSpan(it, "parent")
378+
clientSpan(it, span(0), method, false, false, uri, 401, true)
379+
}
380+
server.distributedRequestTrace(it, trace(0).last())
376381
}
377-
server.distributedRequestTrace(it, trace(0).last())
378382
}
379383

380384
and:
381-
if (isDataStreamsEnabled()) {
385+
if (isDataStreamsEnabled() && !hasExtraErrorInformation()) {
382386
StatsGroup first = TEST_DATA_STREAMS_WRITER.groups.find { it.parentHash == 0 }
383387
verifyAll(first) {
384388
edgeTags.containsAll(DSM_EDGE_TAGS)

0 commit comments

Comments
 (0)