The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(e2e/batches): run the list assertion when a batch completes before cancel
mateo-berriee50f2bc448d
diff --git a/tests/e2e/batches/COVERAGE.md b/tests/e2e/batches/COVERAGE.mdindex 2b1f60cbda7..8a7b68511ec 100644--- a/tests/e2e/batches/COVERAGE.md+++ b/tests/e2e/batches/COVERAGE.md@@ -25,7 +25,7 @@ Bedrock cancel maps to `StopModelInvocationJob` and comes back `cancelling`; thelifecycle asserts it the same way it does for OpenAI (`_CANCEL_ASSERTED_PROVIDERS`).Bedrock has no provider-side list, so list is the proxy's DB-backed managed view: theunified lifecycle lists with the plain `GET /v1/batches` and the batch must appear-there. Both were gated off until LIT-5730, after LIT-4774 landed cancel support.+there. Both were gated off until LIT-5730, after LIT-4774 landed cancel support. A batch that completes inside the 2 s pre-cancel window skips the cancel assertion (a documented vacuous pass for the cancel cell, same as OpenAI); the list assertion runs either way.Bedrock file upload requires a model on the request (`encoded` / `unified` scenarios only);`model_param` and `provider_fallback` are omitted because `POST /bedrock/v1/files` has nomodel-less passthrough path.diff --git a/tests/e2e/batches/test_batches_e2e.py b/tests/e2e/batches/test_batches_e2e.pyindex cb9954b8e09..ed7cf656d01 100644--- a/tests/e2e/batches/test_batches_e2e.py+++ b/tests/e2e/batches/test_batches_e2e.py@@ -293,14 +293,13 @@ def test_batch_lifecycle(f"batch reached {pre_cancel.status!r} before cancel; ""provider likely rejected the input")- if pre_cancel.status == "completed":- return- cancelled = cancel_batch(client, batch.id, key=key, provider=provider)- assert cancelled.id == batch.id- assert cancelled.object == "batch"- assert cancelled.status in {"cancelling", "cancelled"}, (- f"unexpected post-cancel status {cancelled.status!r}"- )+ if pre_cancel.status != "completed":+ cancelled = cancel_batch(client, batch.id, key=key, provider=provider)+ assert cancelled.id == batch.id+ assert cancelled.object == "batch"+ assert cancelled.status in {"cancelling", "cancelled"}, (+ f"unexpected post-cancel status {cancelled.status!r}"+ )if cap.can_list:list_result = client.list_batches(key=key, provider=provider)