Skip to content

Commit 0f99c8a

Browse files
committed
[ISSUE-5161] Added test for the internal tracer start method
1 parent 4351cb3 commit 0f99c8a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

internal/global/trace_test.go

+9
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,12 @@ func TestSpanContextPropagatedWithNonRecordingSpan(t *testing.T) {
235235
assert.Equal(t, sc, span.SpanContext())
236236
assert.False(t, span.IsRecording())
237237
}
238+
239+
func TestStartSpanWithNilContext(t *testing.T) {
240+
ResetForTest(t)
241+
242+
tr := TracerProvider().Tracer("NoPanic")
243+
244+
// nolint:staticcheck // no nil context, but that's the point of the test.
245+
assert.NotPanics(t, func() { tr.Start(nil, "should-not-panic") })
246+
}

0 commit comments

Comments
 (0)