Skip to content

Disconnect tests: give the hanging client seconds, not 0.2 s, to be reached - #13272

Merged
danielhanchen merged 1 commit into
mainfrom
ci-disconnect-test-timeouts
Oct 11, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-disconnect-test-timeouts

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

tests/test_openai_tool_passthrough.py::TestApiMonitorProviderAndCompletionStreams::test_non_streaming_proxy_disconnect_returns_499[openai_embeddings-/v1/embeddings-body1] failed in Backend CI (Python 3.13, l-r) on #13221 and on #13240, two unrelated PRs:

tests/test_openai_tool_passthrough.py:8607: in _run
    await asyncio.wait_for(client.started.wait(), 0.2)
E   TimeoutError

The test starts the route, waits 0.2 s for the route to reach HangingCancelableClient, flips the request to disconnected, then waits 0.5 s for the 499. Locally the route gets there in milliseconds and the test passes 10 of 10 under -n 8. But on a busy xdist worker the first embeddings call does extra setup, and 0.2 s is not enough. The 0.5 s bound is five polls of the 0.1 s is_disconnected watcher, so it is just as tight. The product is fine; the timeouts measure the runner. The same 0.2 s / 0.5 s pair appears in four tests in this file (added in 27e124c).

Fix

Both waits are upper bounds, not latency checks, so use named constants: 10 s to reach the hanging client and 5 s from disconnect to 499. A comment explains why. All seven waits in the file use the constants.

Verification

Scenario main this PR
Normal run (-k "disconnect or hanging or cancel") pass 33 passed
Route takes 0.6 s to reach the client (simulated cold worker) 2 failed 2 passed
Request never disconnects (route would hang) 2 failed 2 failed

So a slow runner no longer fails these tests, while a route that never notices the disconnect still does.

…eached

test_non_streaming_proxy_disconnect_returns_499[openai_embeddings] timed out in Backend CI (l-r) on #13221 and #13240 waiting 0.2 s for the route to reach HangingCancelableClient. The route gets there in milliseconds, but the first embeddings call on a loaded, cold xdist worker can take longer. The 0.5 s bound after the disconnect is five polls of the 0.1 s watcher, equally tight. Both are upper bounds only, so raise them to 10 s and 5 s through named constants used by all seven waits in the file; a route that never reaches the client or never notices the disconnect still fails.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T04:31:22.810157Z c1bc9d4 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: c1bc9d4599

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 11, 2026
@danielhanchen
danielhanchen merged commit c249dca into main Oct 11, 2026
@danielhanchen
danielhanchen deleted the ci-disconnect-test-timeouts branch October 11, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant