MCPcopy
hub / github.com/grafana/dskit / TestManagerRequiresServicesToBeInNewState

Function TestManagerRequiresServicesToBeInNewState

services/manager_test.go:64–78  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

62}
63
64func TestManagerRequiresServicesToBeInNewState(t *testing.T) {
65 t.Parallel()
66
67 s1 := serviceThatDoesntDoAnything()
68 s2 := serviceThatDoesntDoAnything()
69 s3 := serviceThatDoesntDoAnything()
70
71 require.NoError(t, s1.StartAsync(context.Background()))
72 t.Cleanup(func() {
73 require.NoError(t, StopAndAwaitTerminated(context.Background(), s1))
74 })
75
76 _, err := NewManager(s1, s2, s3)
77 require.Error(t, err) // s1 is not New anymore
78}
79
80func TestManagerReactsOnExternalStateChanges(t *testing.T) {
81 t.Parallel()

Callers

nothing calls this directly

Calls 5

StopAndAwaitTerminatedFunction · 0.85
NewManagerFunction · 0.70
StartAsyncMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected