test(passthrough): rename the client reset reader helper

Two packages each declared failingReader in the same test package. The passthrough gate test now uses clientResetReader.
This commit is contained in:
2026-11-29 00:24:16 +00:00
parent 4e87b61932
commit 916070e16d
+3 -3
View File
@@ -284,13 +284,13 @@ func TestPassthroughCostGate_UnparseableObjectRefused(t *testing.T) {
}
}
type failingReader struct{}
type clientResetReader struct{}
func (failingReader) Read([]byte) (int, error) { return 0, errors.New("client reset") }
func (clientResetReader) Read([]byte) (int, error) { return 0, errors.New("client reset") }
func TestPassthroughCostGate_WidenedReadErrorIs400(t *testing.T) {
e := newGateEnv(t, nil)
body := io.MultiReader(strings.NewReader(`{"pad":"`+strings.Repeat("a", maxModelPeekBytes+1024)), failingReader{})
body := io.MultiReader(strings.NewReader(`{"pad":"`+strings.Repeat("a", maxModelPeekBytes+1024)), clientResetReader{})
req := httptest.NewRequest(http.MethodPost, "/openai/v1/native-endpoint", body)
req.ContentLength = -1
req.Header.Set("Authorization", "Bearer sk-alice")