mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-03-17 20:57:51 +02:00
add explicit error handling for span data
This commit is contained in:
parent
75b4d68499
commit
e1c90dca8a
@ -120,7 +120,13 @@ func (tc nameAttributeTestCase) testUCISetsExpectedNameAttribute(t *testing.T) {
|
||||
t.Fatalf("failed to run unary interceptor: %v", err)
|
||||
}
|
||||
|
||||
attributes := exp.spanMap[tc.fullName()][0].Attributes
|
||||
spanData, hasSpanData := exp.spanMap[tc.fullName()]
|
||||
|
||||
if !hasSpanData || len(spanData) == 0 {
|
||||
t.Fatalf("no span data found for name < %s >", tc.fullName())
|
||||
}
|
||||
|
||||
attributes := spanData[0].Attributes
|
||||
|
||||
var actualServiceName string
|
||||
for _, attr := range attributes {
|
||||
|
Loading…
x
Reference in New Issue
Block a user