(t *testing.T)
| 795 | w.WriteHeader(http.StatusOK) |
| 796 | _, _ = w.Write([]byte("ok-now")) |
| 797 | }) |
| 798 | |
| 799 | rec := doForwardProxyRequest(proxy, "GET", originURL+"/bucket/flaky.parquet", http.Header{"Range": []string{"bytes=0-5"}}) |
| 800 | if rec.Code != http.StatusBadRequest { |
| 801 | t.Fatalf("first call: status = %d, want 400", rec.Code) |
| 802 | } |
| 803 | |
| 804 | rec = doForwardProxyRequest(proxy, "GET", originURL+"/bucket/flaky.parquet", http.Header{"Range": []string{"bytes=0-5"}}) |
| 805 | if rec.Code != http.StatusPartialContent { |
| 806 | t.Fatalf("retry: status = %d, want 206 (cache must not have stored the prior error)", rec.Code) |
| 807 | } |
| 808 | if atomic.LoadInt32(&calls) != 2 { |
| 809 | t.Errorf("origin calls = %d, want 2 (the cache must not serve a previously-failed request from cache)", calls) |
| 810 | } |
| 811 | } |
| 812 | |
| 813 | // TestHandleProxyNetworkErrorStill502: when the origin is fully |
| 814 | // unreachable (no HTTP response at all), 502 is still the right answer — |
| 815 | // there was no upstream status to forward, and httpfs's "retry on 5xx" |
| 816 | // behaviour is appropriate here. |
nothing calls this directly
no test coverage detected