(ctx context.Context, port uint16)
| 34 | } |
| 35 | |
| 36 | func waitForGateway(ctx context.Context, port uint16) error { |
| 37 | ch := time.After(10 * time.Second) |
| 38 | |
| 39 | for { |
| 40 | r, err := http.Get(fmt.Sprintf("http://localhost:%d/healthz", port)) |
| 41 | if err == nil && r.StatusCode == http.StatusOK { |
| 42 | return nil |
| 43 | } |
| 44 | |
| 45 | grpclog.Infof("Waiting for localhost:%d to get ready", port) |
| 46 | select { |
| 47 | case <-ctx.Done(): |
| 48 | return err |
| 49 | case <-ch: |
| 50 | return err |
| 51 | case <-time.After(10 * time.Millisecond): |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | func runServers(ctx context.Context) <-chan error { |
| 57 | ch := make(chan error, 3) |
no outgoing calls
no test coverage detected