Skip to content

Commit 53f5d20

Browse files
Fix flaky out-of-order comparison for http client test. (#9163)
1 parent 2a4f690 commit 53f5d20

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ abstract class HttpClientTest extends VersionedNamingTestBase {
293293
status == 200
294294
assertTraces(2) {
295295
trace(size(2)) {
296+
sortSpansByStart()
296297
basicSpan(it, "parent")
297298
clientSpan(it, span(0), method)
298299
}
@@ -439,6 +440,7 @@ abstract class HttpClientTest extends VersionedNamingTestBase {
439440
// only one trace (client).
440441
assertTraces(1) {
441442
trace(size(2)) {
443+
sortSpansByStart()
442444
basicSpan(it, "parent")
443445
clientSpan(it, span(0), method, renameService)
444446
}
@@ -482,6 +484,7 @@ abstract class HttpClientTest extends VersionedNamingTestBase {
482484
assertTraces(1) {
483485
sortSpansByStart()
484486
trace(size(3)) {
487+
sortSpansByStart()
485488
basicSpan(it, "parent")
486489
clientSpan(it, span(0), method)
487490
basicSpan(it, "child", span(0))
@@ -721,6 +724,7 @@ abstract class HttpClientTest extends VersionedNamingTestBase {
721724
def thrownException = ex instanceof ExecutionException ? ex.cause : ex
722725
assertTraces(1) {
723726
trace(size(2)) {
727+
sortSpansByStart()
724728
basicSpan(it, "parent", null, thrownException)
725729
clientSpan(it, span(0), method, false, false, uri, null, true, thrownException)
726730
}

0 commit comments

Comments
 (0)