Repository navigation
test: bound prefetch cleanup waits for saturated corpus runs - #4233
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 267a2aeb94
ℹ️ 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".
…4234) ## Summary Fixes the parse-stage lifecycle race that failed `test_submit_failure_cleans_every_admitted_future_and_reservation` in corpus runs 2, 5, and 6 while passing at every lighter scope. ## Problem (evidence) `CensusParseStage._refresh_lifecycle_state_locked` published `_warm_idle.set()` **before** `_writer_admission_ready.set()`. `wait_until_idle` returns the instant the first event is set, so a caller thread can read `writer_admission_ready()` in the two-instruction window before the second — exactly the corpus run 6 failure (`wait_until_idle(30)` True, then `assert stage.writer_admission_ready()` False; receipt `cf7379a5`, worker gw5, first test on the worker so no cross-test pollution). Under the free-threaded 3.14t build at full-corpus contention this interleaving is realistic; run 6's receipt ruled out the earlier load-latency theory (#4233 widened waits and it still failed). ## Solution Set the dependent gate first and the wake signal last in the refresh path, with the mirrored order in `_begin_warm_operation`'s clear path so no reader can observe idle cleared while admission is still open. Stop-requested semantics unchanged. ## Verification - `devtools test tests/unit/daemon/test_parse_prefetch.py tests/unit/sources/test_live_batch_support.py` → 166 passed. - `devtools verify --quick` → all 15 gates ok. - The race itself is only observable under corpus-scale contention; corpus run 7 after merge is the decisive check. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
Summary
Removes the load-sensitivity that failed
test_submit_failure_cleans_every_admitted_future_and_reservationin corpus runs 2 and 5 while passing at every lighter scope.Problem (evidence)
The test bounds its executor-thread startup wait at 2s and its idle/release waits at 5s. A full-corpus run executes 3 pytest processes × 8 xdist workers on this host, and under that saturation thread scheduling can exceed 2s — the test failed only in full-corpus runs (2b00a953, 215385b4) and passed focused, at file scope, and in three consecutive daemon-directory runs. The timeouts exist to bound a genuinely hung test, not to assert scheduling latency.
Solution
Waits widened to 30s (start, release, idle). The protected invariant — a mid-batch submit failure strands no futures or byte reservations — is asserted unchanged; a real hang still fails within the bound.
Verification
devtools test tests/unit/daemon/test_parse_prefetch.py→ 23 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA