var startServerShutdown … var handlerLock … var backendCrt … var backendKey … // TestGracefulShutdownForActiveHTTP2Streams checks if graceful shut down of HTTP2 server works. // It expects that all active connections will be finished (without any errors) before the server exits. // // The test sends 25 requests to the target server in parallel. Each request is held by the target server for 60s. // As soon as the target server receives the last request the test calls backendServer.Config.Shutdown which gracefully shuts down the server without interrupting any active connections. // // See more at: https://github.com/golang/go/issues/39776 // // Note this test will fail on upstream golang 1.15 func TestGracefulShutdownForActiveHTTP2Streams(t *testing.T) { … } type backendHTTPHandler … func (b *backendHTTPHandler) ServeHTTP(w http.ResponseWriter, _ *http.Request) { … }