MCPcopy
hub / github.com/grpc/grpc-go / CloseForTesting

Function CloseForTesting

credentials/alts/internal/handshaker/service/service.go:78–91  ·  view source on GitHub ↗

CloseForTesting closes all open connections to the handshaker service. For testing purposes only.

()

Source from the content-addressed store, hash-verified

76//
77// For testing purposes only.
78func CloseForTesting() error {
79 for _, hsConn := range hsConnMap {
80 if hsConn == nil {
81 continue
82 }
83 if err := hsConn.Close(); err != nil {
84 return err
85 }
86 }
87
88 // Reset the connection map.
89 hsConnMap = make(map[string]*grpc.ClientConn)
90 return nil
91}

Callers 3

TestFullHandshakeMethod · 0.92

Calls 1

CloseMethod · 0.65

Tested by 3

TestFullHandshakeMethod · 0.74