Skip to content

Commit d332072

Browse files
committed
Wider exception check in AWS sdk v1 tests
added the error that caused the flake as an acceptable error for the test also relaxed the check on the text of the SdkClientException on AI suggestion.
1 parent 3ff796a commit d332072

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

dd-java-agent/instrumentation/aws-java/aws-java-sdk-1.11/src/test/groovy/LegacyAWS1ClientForkedTest.groovy

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import com.amazonaws.services.sqs.model.SendMessageRequest
3535
import datadog.trace.agent.test.AgentTestRunner
3636
import datadog.trace.api.DDSpanTypes
3737
import datadog.trace.bootstrap.instrumentation.api.Tags
38-
import datadog.trace.test.util.Flaky
3938
import org.apache.http.conn.HttpHostConnectException
4039
import org.apache.http.impl.execchain.RequestAbortedException
4140
import org.json.XML
@@ -364,7 +363,6 @@ class LegacyAWS1ClientForkedTest extends AgentTestRunner {
364363
}
365364
}
366365

367-
@Flaky("assertTraces sometimes fails")
368366
def "timeout and retry errors captured"() {
369367
setup:
370368
def server = httpServer {
@@ -413,7 +411,7 @@ class LegacyAWS1ClientForkedTest extends AgentTestRunner {
413411
try {
414412
errorTags AmazonClientException, ~/Unable to execute HTTP request/
415413
} catch (AssertionError e) {
416-
errorTags SdkClientException, "Unable to execute HTTP request: Request did not complete before the request timeout configuration."
414+
errorTags SdkClientException, ~/Unable to execute HTTP request.*(?:interrupted|timeout).*/
417415
}
418416
defaultTags()
419417
}
@@ -436,7 +434,11 @@ class LegacyAWS1ClientForkedTest extends AgentTestRunner {
436434
try {
437435
errorTags SocketException, "Socket closed"
438436
} catch (AssertionError e) {
439-
errorTags RequestAbortedException, "Request aborted"
437+
try {
438+
errorTags RequestAbortedException, "Request aborted"
439+
} catch (AssertionError e2) {
440+
errorTags InterruptedIOException, ~/.*(?:interrupted|timeout).*/
441+
}
440442
}
441443
defaultTags()
442444
}

0 commit comments

Comments
 (0)