Merge pull request #12782 from ptabor/20210316-fixes

Integration: Test flakiness fixes
This commit is contained in:
Piotr Tabor
2021-03-19 20:10:11 +01:00
committed by GitHub
20 changed files with 112 additions and 19 deletions

View File

@@ -386,18 +386,14 @@ func (e *Etcd) Close() {
}
func stopServers(ctx context.Context, ss *servers) {
shutdownNow := func() {
// first, close the http.Server
ss.http.Shutdown(ctx)
// then close grpc.Server; cancels all active RPCs
ss.grpc.Stop()
}
// first, close the http.Server
ss.http.Shutdown(ctx)
// do not grpc.Server.GracefulStop with TLS enabled etcd server
// See https://github.com/grpc/grpc-go/issues/1384#issuecomment-317124531
// and https://github.com/etcd-io/etcd/issues/8916
if ss.secure {
shutdownNow()
ss.grpc.Stop()
return
}
@@ -415,7 +411,7 @@ func stopServers(ctx context.Context, ss *servers) {
case <-ctx.Done():
// took too long, manually close open transports
// e.g. watch streams
shutdownNow()
ss.grpc.Stop()
// concurrent GracefulStop should be interrupted
<-ch