MCPcopy Create free account
hub / github.com/cortexproject/cortex / TestServiceName

Function TestServiceName

pkg/util/services/basic_service_test.go:317–327  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

315}
316
317func TestServiceName(t *testing.T) {
318 s := NewIdleService(nil, nil).WithName("test name")
319 require.Equal(t, "test name", DescribeService(s))
320
321 ctx := t.Context()
322 require.NoError(t, s.StartAsync(ctx))
323
324 // once service has started, BasicService will not allow changing the name
325 s.WithName("new")
326 require.Equal(t, "test name", DescribeService(s))
327}

Callers

nothing calls this directly

Calls 6

NewIdleServiceFunction · 0.85
DescribeServiceFunction · 0.85
WithNameMethod · 0.80
EqualMethod · 0.65
StartAsyncMethod · 0.65
ContextMethod · 0.45

Tested by

no test coverage detected