Repository navigation
Wait on the pooled fetch itself in the closed-request browser test - #12835
Merged
Merged
Conversation
test_a_closed_request_cancels_the_fetch returned 499 and then drained the fetch pool with no-ops before reading what the fake fetch saw. Idle workers finish those no-ops while the fetch's own thread may not have recorded anything yet, so a loaded CI worker read an empty dict (KeyError 'cancelled' on #12816, which does not touch the browser route). The fake fetch now sets an event when it is done and the test waits on that.
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
studio/backend/tests/test_browser_routes.py::test_a_closed_request_cancels_the_fetchfailed on #12816 withKeyError: 'cancelled'. That PR does not touch the browser route, and the test passes on main 5 of 5 locally, so it is a race in the test. It came in with #12347 (in-app browser panel).The route returns 499 on a client disconnect without waiting for its pool task, which is correct: it sets the cancel event and lets the worker wind down. The test then tried to wait for that worker by submitting one no-op per pool worker and waiting on each. That does not wait for the fetch: idle workers finish the no-ops while the fetch's own thread can still be before the line that records what it saw. On a loaded CI worker the test read an empty dict.
Fix
The fake fetch sets a
threading.Eventonce it has recorded the cancel, in afinally, and the test waits on that event (10 s) before asserting. No product change.Verification
tests/test_browser_routes.py: 22 passed._fetch_and_build, which widens the window CI hit:cancel_eventon disconnect, this version fails onseen["cancelled"] is True. The guard still checks the behaviour it was written for.tests/test_formatter_fixed_point.pypasses.