Skip to content

Commit

Permalink
add global trace state
Browse files Browse the repository at this point in the history
  • Loading branch information
amanakin committed May 9, 2024
1 parent f4cfe82 commit 6ac8976
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions sdk/trace/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var (
tid trace.TraceID
sid trace.SpanID
sc trace.SpanContext
ts trace.TraceState

handler = &storingHandler{}
)
Expand All @@ -59,6 +60,7 @@ func init() {
SpanID: sid,
TraceFlags: 0x1,
})
ts, _ = trace.ParseTraceState("k=v")

otel.SetErrorHandler(handler)
}
Expand Down Expand Up @@ -330,10 +332,6 @@ func TestStartSpanWithParent(t *testing.T) {
t.Error(err)
}

ts, err := trace.ParseTraceState("k=v")
if err != nil {
t.Error(err)
}
sc2 := sc.WithTraceState(ts)
_, s3 := tr.Start(trace.ContextWithRemoteSpanContext(ctx, sc2), "span3-sampled-parent2")
if err := checkChild(t, sc2, s3); err != nil {
Expand Down Expand Up @@ -1923,9 +1921,6 @@ func TestEmptyRecordingSpanDroppedAttributes(t *testing.T) {
}

func TestSpanAddLink(t *testing.T) {
ts, err := trace.ParseTraceState("k=v")
require.NoError(t, err)

tests := []struct {
name string
attrLinkCountLimit int
Expand Down

0 comments on commit 6ac8976

Please sign in to comment.