MCPcopy Index your code
hub / github.com/containerd/containerd / validateRootSpan

Function validateRootSpan

integration/client/tracing.go:49–61  ·  view source on GitHub ↗

validateRootSpan takes span slice as input, check if there are rootspans match the expected name and the status code is not error

(t *testing.T, spanNameExpected string, spans []tracetest.SpanStub)

Source from the content-addressed store, hash-verified

47// validateRootSpan takes span slice as input, check if there are rootspans match the expected
48// name and the status code is not error
49func validateRootSpan(t *testing.T, spanNameExpected string, spans []tracetest.SpanStub) {
50 for _, span := range spans {
51 //We only look for root span
52 //A span is root span if its parent SpanContext is invalid
53 if !span.Parent.IsValid() {
54 if span.Name == spanNameExpected {
55 assert.NotEqual(t, span.Status.Code, codes.Error)
56 return
57 }
58 }
59 }
60 t.Fatalf("Expected span %s not found", spanNameExpected)
61}

Callers 1

TestImagePullWithTracingFunction · 0.85

Calls 1

IsValidMethod · 0.80

Tested by 1

TestImagePullWithTracingFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…