-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
test(e2e): harden the suite against response-cache cross-talk, slow providers and single upstream blips #37957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2d2b6bf
96ac86d
2f1baeb
e20c9f9
3b1f8cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,7 @@ | |
| MODEL = "claude-haiku-4-5" | ||
| ACCUMULATE_CALLS = 24 | ||
| BURST = 6 | ||
| BURST_TOLERATED_FAILURES = 1 | ||
| # proxy_batch_write_at (60s) flushes the spend to the DB and default_redis_ttl (20s) | ||
| # expires the counter; this waits out both. | ||
| COLD_WAIT_SECONDS = 80 | ||
|
|
@@ -174,9 +175,11 @@ def one(_: int) -> StreamingResponse: | |
|
|
||
| with ThreadPoolExecutor(max_workers=BURST) as pool: | ||
| burst_results = list(pool.map(one, range(BURST))) | ||
| assert all(r.ok for r in burst_results), ( | ||
| "some burst calls failed; cannot exercise concurrent reseed. " | ||
| f"statuses={[r.status_code for r in burst_results]}" | ||
| failed = [r for r in burst_results if not r.ok] | ||
| assert len(failed) <= BURST_TOLERATED_FAILURES, ( | ||
| "too many burst calls failed; cannot exercise concurrent reseed. " | ||
| f"statuses={[r.status_code for r in burst_results]} " | ||
| f"bodies={[r.body[:300] for r in failed]}" | ||
| ) | ||
|
Comment on lines
+178
to
183
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The threshold accepts any failed response, so one proxy-side regression can pass while the aggregate counter assertion still succeeds. Rule Used: What: Flag any modifications to existing tests and... (source) Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
|
|
||
| counter: float | None = None | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Streaming failures render as
status -1orstatus 500, so neither regex matches and transient network or upstream failures are not rerun.