(t *testing.T)
| 595 | } |
| 596 | |
| 597 | func TestInfer_GlobalDeadline504(t *testing.T) { |
| 598 | cfg := testConfig(10_000, false) |
| 599 | cfg.Server.RequestTimeoutMS = 80 |
| 600 | srv := New(cfg) |
| 601 | srv.adapters["small-model"] = &blockingInferAdapter{ |
| 602 | started: make(chan struct{}), |
| 603 | release: make(chan struct{}), |
| 604 | name: "small-model", |
| 605 | } |
| 606 | ts := httptest.NewServer(srv.Routes()) |
| 607 | defer ts.Close() |
| 608 | |
| 609 | status, body := postInfer(t, ts.URL, map[string]any{ |
| 610 | "tenant_id": "team-a", |
| 611 | "task_type": "simple", |
| 612 | "input": map[string]any{"text": "hello"}, |
| 613 | "options": map[string]any{"stream": false, "max_tokens": 128}, |
| 614 | }) |
| 615 | if status != http.StatusGatewayTimeout { |
| 616 | t.Fatalf("expected 504, got %d body=%s", status, string(body)) |
| 617 | } |
| 618 | assertStructuredError(t, body, errCodeGatewayTimeout) |
| 619 | } |
| 620 | |
| 621 | func TestInfer_ExecutionFailed502(t *testing.T) { |
| 622 | // mock adapter sleeps ~20ms; timeout 1ms forces deadline exceeded. |
nothing calls this directly
no test coverage detected