CloseForTesting closes all open connections to the handshaker service. For testing purposes only.
()
| 76 | // |
| 77 | // For testing purposes only. |
| 78 | func 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 | } |