Skip to content

Commit 368152f

Browse files
fix(ot): Fix OpenTracing tests with 128b tid (DataDog#6188)
1 parent cda2794 commit 368152f

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

dd-trace-ot/src/ot31CompatibilityTest/groovy/OT31ApiTest.groovy

+3-4
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,10 @@ class OT31ApiTest extends DDSpecification {
114114
def expectedTraceparent = "00-${traceId.toHexStringPadded(32)}" +
115115
"-${DDSpanId.toHexStringPadded(spanId)}" +
116116
"-" + (propagatedPriority > 0 ? "01" : "00")
117-
def expectedTracestate = "dd=s:${propagatedPriority}"
118117
def effectiveSamplingMechanism = contextPriority == UNSET ? AGENT_RATE : samplingMechanism
119-
if (propagatedPriority > 0) {
120-
expectedTracestate+= ";t.dm:-" + effectiveSamplingMechanism
121-
}
118+
def expectedTracestate = "dd=s:${propagatedPriority}" +
119+
(propagatedPriority > 0 ? ";t.dm:-" + effectiveSamplingMechanism : "") +
120+
";t.tid:${traceId.toHexStringPadded(32).substring(0, 16)}"
122121
def expectedTextMap = [
123122
"x-datadog-trace-id" : context.toTraceId(),
124123
"x-datadog-parent-id" : context.toSpanId(),

dd-trace-ot/src/ot33CompatibilityTest/groovy/OT33ApiTest.groovy

+3-4
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,10 @@ class OT33ApiTest extends DDSpecification {
103103
def expectedTraceparent = "00-${traceId.toHexStringPadded(32)}" +
104104
"-${DDSpanId.toHexStringPadded(spanId)}" +
105105
"-" + (propagatedPriority > 0 ? "01" : "00")
106-
def expectedTracestate = "dd=s:${propagatedPriority}"
107106
def effectiveSamplingMechanism = contextPriority == UNSET ? AGENT_RATE : samplingMechanism
108-
if (propagatedPriority > 0) {
109-
expectedTracestate+= ";t.dm:-" + effectiveSamplingMechanism
110-
}
107+
def expectedTracestate = "dd=s:${propagatedPriority}" +
108+
(propagatedPriority > 0 ? ";t.dm:-" + effectiveSamplingMechanism : "") +
109+
";t.tid:${traceId.toHexStringPadded(32).substring(0, 16)}"
111110
def expectedTextMap = [
112111
"x-datadog-trace-id" : context.toTraceId(),
113112
"x-datadog-parent-id" : context.toSpanId(),

0 commit comments

Comments
 (0)