MCPcopy
hub / github.com/marmotedu/iam / TestShutdownManagerName

Function TestShutdownManagerName

pkg/shutdown/shutdown_test.go:236–254  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

234}
235
236func TestShutdownManagerName(t *testing.T) {
237 c := make(chan int, 100)
238 gs := New()
239
240 gs.AddShutdownCallback(ShutdownFunc(func(shutdownManager string) error {
241 if shutdownManager == "test-sm" {
242 c <- 1
243 }
244 return nil
245 }))
246
247 gs.StartShutdown(SMFinishFunc(func() error {
248 return nil
249 }))
250
251 if len(c) != 1 {
252 t.Error("Expected shutdownManager to be 'test-sm'.")
253 }
254}

Callers

nothing calls this directly

Calls 6

ShutdownFuncFuncType · 0.85
SMFinishFuncFuncType · 0.85
NewFunction · 0.70
AddShutdownCallbackMethod · 0.65
StartShutdownMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…