File tree 1 file changed +6
-2
lines changed
dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/asserts
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -125,10 +125,14 @@ class SpanAssert {
125
125
}
126
126
127
127
def childOf (DDSpan parent ) {
128
+ assert span. parentId != 0L , " Expected spanId=${ span.spanId} to be a child of spanId=${ parent.spanId} , but it is a root span (no parent)"
129
+ assert span. traceId == parent. traceId, " Expected spanId=${ span.spanId} to be a child of spanId=${ parent.spanId} , but they have different traceIds"
130
+ checked. traceId = true
131
+ if (span. parentId != parent. spanId && span. parentId == previous. spanId) {
132
+ assert span. parentId == parent. spanId, " Expected spanId=${ span.spanId} to be a child of spanId=${ parent.spanId} , but it is a child of ${ previous} "
133
+ }
128
134
assert span. parentId == parent. spanId
129
135
checked. parentId = true
130
- assert span. traceId == parent. traceId
131
- checked. traceId = true
132
136
}
133
137
134
138
def childOfPrevious () {
You can’t perform that action at this time.
0 commit comments