Watch: make the open-done wait test independent of scheduler delays #4629

Open
tyr0nsur wants to merge 1 commit from upstream-pr/4629 into main
tyr0nsur commented 2026-12-01 00:17:58 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-12-01T00:17:58Z.


What it changes

The cooperative-yield case of watch::ask_holds::wait_open_done_covers_immediate_fast_spin_yield_cleared_and_timeout expects the sixth is_done poll to return Done before 10 ms of real time elapse. A scheduling delay during the cooperative phase can make that same poll sequence return TimedOut. This was reported on main in #4379 and happened again in the Windows check for #4595.

The test now advances a controlled clock, checks that the immediate and fast-spin paths read no clock, and covers completion, clearing and the exact deadline. Production passes Instant::now and retains the same poll order, budget and cooperative yields.

How it was tested

  • GPU and profile: Windows 11, Ryzen 7 5800X. The wait test only needs the CPU and uses no title data.
  • Before: the isolated helper and test reproduced TimedOut instead of Done with a simulated 20 ms scheduling pause in the first cooperative poll.
  • After: the same isolated test passed with the simulated pause. The timeout case still checks the exact 2,000 µs boundary.
  • cargo test --locked -p victory-gpu --lib: 1133 passed, 66 ignored.
  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings passed. Staged asset policy passed.

Checked for overlap

  • I searched open and closed issues and pull requests for the test, helper and symptom, and listed the open PRs touching watch.rs. Related: #2814 introduced the wait, #4379 reports the flake, and #4619 addresses a separate watch test involving the shared journal. I found no open PR changing this test or helper to control the clock.

Reviewed with Claude Code (Opus 5.5).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5576256388 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4629). Originally posted by [tyr0nsur](https://github.com/tyr0nsur) on 2026-12-01T00:17:58Z. --- ## What it changes The cooperative-yield case of `watch::ask_holds::wait_open_done_covers_immediate_fast_spin_yield_cleared_and_timeout` expects the sixth `is_done` poll to return `Done` before 10 ms of real time elapse. A scheduling delay during the cooperative phase can make that same poll sequence return `TimedOut`. This was reported on main in #4379 and happened again in the [Windows check for #4595](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46540895872/job/142278961513). The test now advances a controlled clock, checks that the immediate and fast-spin paths read no clock, and covers completion, clearing and the exact deadline. Production passes `Instant::now` and retains the same poll order, budget and cooperative yields. ## How it was tested - GPU and profile: Windows 11, Ryzen 7 5800X. The wait test only needs the CPU and uses no title data. - Before: the isolated helper and test reproduced `TimedOut` instead of `Done` with a simulated 20 ms scheduling pause in the first cooperative poll. - After: the same isolated test passed with the simulated pause. The timeout case still checks the exact 2,000 µs boundary. - `cargo test --locked -p victory-gpu --lib`: 1133 passed, 66 ignored. - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` passed. Staged asset policy passed. ## Checked for overlap - [x] I searched open and closed issues and pull requests for the test, helper and symptom, and listed the open PRs touching `watch.rs`. Related: #2814 introduced the wait, #4379 reports the flake, and #4619 addresses a separate watch test involving the shared journal. I found no open PR changing this test or helper to control the clock. Reviewed with Claude Code (Opus 5.5).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/4629:upstream-pr/4629'
git switch 'upstream-pr/4629'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/4629'
git switch 'upstream-pr/4629'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/4629'
git switch 'upstream-pr/4629'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/4629'
git switch 'main'
git merge --squash 'upstream-pr/4629'
git switch 'main'
git merge --ff-only 'upstream-pr/4629'
git switch 'main'
git merge 'upstream-pr/4629'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!4629
No description provided.