TestHandleProxyNetworkErrorStill502: when the origin is fully unreachable (no HTTP response at all), 502 is still the right answer — there was no upstream status to forward, and httpfs's "retry on 5xx" behaviour is appropriate here.
(t *testing.T)
| 744 | } |
| 745 | } |
| 746 | |
| 747 | // TestHandleProxyForwardsOrigin404Verbatim: a 404 must stay a 404 so |
| 748 | // DuckDB / DuckLake can distinguish "object missing" (terminal) from |
| 749 | // "transient gateway error" (retriable). |
| 750 | func TestHandleProxyForwardsOrigin404Verbatim(t *testing.T) { |
| 751 | proxy := newTestProxy(t) |
| 752 | _, originURL := newTestServer(t, func(w http.ResponseWriter, r *http.Request) { |
| 753 | w.WriteHeader(http.StatusNotFound) |
| 754 | _, _ = w.Write([]byte("missing")) |
| 755 | }) |
| 756 | rec := doForwardProxyRequest(proxy, "GET", originURL+"/bucket/gone.parquet", http.Header{"Range": []string{"bytes=0-1"}}) |
| 757 | if rec.Code != http.StatusNotFound { |
| 758 | t.Fatalf("status = %d, want 404 forwarded verbatim", rec.Code) |
| 759 | } |
| 760 | } |
nothing calls this directly
no test coverage detected