(ctx context.Context, port int64)
| 1429 | } |
| 1430 | |
| 1431 | func isPortBusy(ctx context.Context, port int64) bool { |
| 1432 | d := net.Dialer{Timeout: 2 * time.Second} |
| 1433 | conn, err := d.DialContext(ctx, "tcp", fmt.Sprintf("127.0.0.1:%d", port)) |
| 1434 | if err != nil { |
| 1435 | return false |
| 1436 | } |
| 1437 | _ = conn.Close() |
| 1438 | return true |
| 1439 | } |
| 1440 | |
| 1441 | func isCoderRunning(ctx context.Context, baseURL string) bool { |
| 1442 | ctx, cancel := context.WithTimeout(ctx, 2*time.Second) |
no test coverage detected