MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / TestShutdown

Method TestShutdown

server/server_test.go:89–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87}
88
89func (s *ServerTestSuite) TestShutdown() {
90 _, cancel := context.WithCancel(context.Background())
91 defer cancel()
92
93 srv, err := server.Start(cancel, s.router())
94 s.Require().NoError(err)
95 s.NotNil(srv)
96
97 // Test graceful shutdown
98 shutdownCtx, shutdownCancel := context.WithTimeout(s.T().Context(), 10*time.Second)
99 defer shutdownCancel()
100
101 // Should not panic or hang
102 s.NotPanics(func() {
103 srv.Shutdown(shutdownCtx)
104 })
105}
106
107func (s *ServerTestSuite) TestWithCORS() {
108 tests := []struct {

Callers

nothing calls this directly

Calls 4

StartFunction · 0.92
BackgroundMethod · 0.80
TMethod · 0.80
ShutdownMethod · 0.80

Tested by

no test coverage detected