TestHandleProxyForwardsOrigin416Verbatim: Range Not Satisfiable carries semantically important metadata for DuckLake; collapsing to 502 made it look like a network error.
(t *testing.T)
| 692 | } |
| 693 | |
| 694 | for _, tt := range tests { |
| 695 | t.Run(tt.name, func(t *testing.T) { |
| 696 | proxy := newTestProxy(t) |
| 697 | var calls int32 |
| 698 | _, originURL := newTestServer(t, func(w http.ResponseWriter, r *http.Request) { |
| 699 | atomic.AddInt32(&calls, 1) |
| 700 | w.WriteHeader(tt.status) |
| 701 | _, _ = fmt.Fprintf(w, "status=%d", tt.status) |
| 702 | }) |
| 703 | |
| 704 | rec := doForwardProxyRequest(proxy, "GET", originURL+"/bucket/terminal.parquet", http.Header{"Range": []string{"bytes=0-1"}}) |
| 705 | if rec.Code != tt.status { |
| 706 | t.Fatalf("status = %d, want %d", rec.Code, tt.status) |
| 707 | } |
| 708 | if atomic.LoadInt32(&calls) != 1 { |
| 709 | t.Fatalf("origin calls = %d, want 1 for terminal status %d", calls, tt.status) |
| 710 | } |
nothing calls this directly
no test coverage detected