(cc *grpc.ClientConn)
| 253 | } |
| 254 | |
| 255 | func waitForReady(cc *grpc.ClientConn) error { |
| 256 | ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) |
| 257 | defer cancel() |
| 258 | for { |
| 259 | s := cc.GetState() |
| 260 | if s == connectivity.Ready { |
| 261 | return nil |
| 262 | } |
| 263 | if !cc.WaitForStateChange(ctx, s) { |
| 264 | // ctx got timeout or canceled. |
| 265 | return ctx.Err() |
| 266 | } |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | // Stop stops ss and cleans up all resources it consumed. |
| 271 | func (ss *StubServer) Stop() { |
no test coverage detected