test(e2e): pin query params and multipart form fields as replay match-key identity

The canonical request already folds params and form into the digest, but
nothing asserted it, so dropping either from canonicalize() left all 92
fixture tests green. Two GETs differing only in query string, or two
uploads differing only in a form field, would share a replay pool and
FIFO-pop each other's recorded response.

Resolves LIT-5890
This commit is contained in:
mubashir1osmani 2026-08-20 15:59:34 -04:00
parent 487356733c
commit 80cb65502c

View file

@ -140,11 +140,21 @@ class TestKeyDistinctness:
second = request(headers={"traceparent": "00-cc-dd-01", "x-api-key": "two"})
assert canonicalize(first).key == canonicalize(second).key
def test_query_params_are_identity(self) -> None:
first = request("get", "/v1/vector_stores", params={"limit": "100"})
second = request("get", "/v1/vector_stores", params={"limit": "10"})
assert canonicalize(first).key != canonicalize(second).key
def test_secret_set_versus_unset_stays_distinct(self) -> None:
with_key = request(body={"api_key": "sk-live-aaaaaaaaaaaaaaaa"})
without_key = request(body={"api_key": None})
assert canonicalize(with_key).key != canonicalize(without_key).key
def test_form_fields_are_identity(self) -> None:
first = request("upload", "/v1/files", form={"purpose": "assistants"}, file_sha256="a" * 64)
second = request("upload", "/v1/files", form={"purpose": "batch"}, file_sha256="a" * 64)
assert canonicalize(first).key != canonicalize(second).key
def test_file_content_is_identity(self) -> None:
first = request(
"upload", "/v1/files", file_name="batch.jsonl", file_sha256="a" * 64, file_bytes=10