TestRouting_NoInstanceReturns503 exercises the phase-2-future safety guard: a configured cluster with zero usable instances must return 503, not panic on a nil pickInstance().
(t *testing.T)
| 181 | // guard: a configured cluster with zero usable instances must return 503, |
| 182 | // not panic on a nil pickInstance(). |
| 183 | func TestRouting_NoInstanceReturns503(t *testing.T) { |
| 184 | rs := newRoutingTestServer("good-id") |
| 185 | |
| 186 | w := httptest.NewRecorder() |
| 187 | rs.handleRelay(w, newRelayRequest(http.MethodPost, "/relay/good-id", validInnerPacket)) |
| 188 | |
| 189 | if w.Code != http.StatusServiceUnavailable { |
| 190 | t.Fatalf("expected 503 when cluster has no instance, got %d (body: %s)", |
| 191 | w.Code, w.Body.String()) |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | // TestRouting_TrailingSlashTolerated: POST /relay/<id>/ should resolve the |
| 196 | // same as POST /relay/<id>. Some HTTP clients and proxies normalize paths |
nothing calls this directly
no test coverage detected