Fix flaky aws2 sqs test (#9888)

This commit is contained in:
Lauri Tulmin 2023-11-16 17:58:23 +02:00 committed by GitHub
parent 28e6519a69
commit 2bcae0b010
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -431,6 +431,17 @@ abstract class AbstractAws2SqsTracingTest extends InstrumentationSpecification {
"$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
}
}
if (!xrayInjectionEnabled) {
// one of the 3 process spans is expected to not have a span link, sort them so that the
// last one is the one with missing link
if (spans.get(1).links.empty) {
spans.swap(1, 5)
spans.swap(2, 6)
} else if (spans.get(3).links.empty) {
spans.swap(3, 5)
spans.swap(4, 6)
}
}
for (int i: 0..2) {
span(1 + 2*i) {
name "testSdkSqs process"