diff --git a/instrumentation/testing/testing.go b/instrumentation/testing/testing.go index 16a7ca30..c1e30124 100644 --- a/instrumentation/testing/testing.go +++ b/instrumentation/testing/testing.go @@ -106,6 +106,10 @@ func StartTestFromCaller(t *testing.T, pc uintptr, opts ...Option) *Test { // Set test code func (test *Test) SetTestCode(pc uintptr) { + test.codePC = pc + if test.span == nil { + return + } pName, _, fBoundaries := getPackageAndNameAndBoundaries(pc) test.span.SetTag("test.suite", pName) if fBoundaries != "" {