Skip to content

test: wait for the end state in four timing-sensitive tests - #430

Merged
ElbertePlinio merged 1 commit into
mainfrom
test/timing-flakes
Oct 29, 2026
Merged

ElbertePlinio merged 1 commit into
mainfrom
test/timing-flakes

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

Four tests checked a state once, at a moment when the system could still be on its way there. Each now waits for the end state, or checks an order instead of a fixed window.

scales_with_the_host_scale_factor (#408) waited for the expanded window size, then took one screenshot, which could still show the thumbnail frame. A new Screen::wait_color waits until the bar color shows at the probe point and returns that frame. The 1x expand test in the same file had the same pattern and uses it too.

The evidence export kill test (#412) read /proc/<pid>/stat of the killed descendant once. kill returns before the kernel ends the target, so the test now polls for up to 5 s. The 2.5 s settle assertion is unchanged.

The Chrome profile crash test (#420) waited only for the browser's leader process. The profile claim counts the whole process group, so the test now waits until the group is gone. The check that a live owner refuses the profile is unchanged.

The in-flight observation drain test (#423) slept 40 ms and expected the lease to be still waiting. A desktop wait cancels its sample when it sees a lease (TAKEOVER_POLL_MS), so a grant inside that window is correct behavior. The fake capture tools now record their pid, and the test checks that the sample had ended when the lease was granted. All eight transport and kind cases stay.

Closes #408
Closes #412
Closes #420
Closes #423

Requirement Verified by Scenario and edge cases Result Evidence
#408 waits for the expanded frame HiDPI test pinned to one CPU, 10 runs before and after Loaded host, 2x scale Before: 7 of 10 failed on "bar color"; after: 10 of 10 passed 408/before.txt, 408/after.txt
#412 waits for the descendant to end Test pinned to one CPU next to three CPU hogs, 10 runs each Old and new test 10 of 10 passed both ways; the CI failure did not reproduce locally, and the poll removes the single read 412/before-*.log, 412/after-*.log
#420 waits for the process group Real headed Chrome under Xvfb with PICKFORGE_REQUIRE_BROWSER=1 Kill, group exit, third claim Passes 420/run1.txt
#423 no fixed window, eight cases kept Mutant that skips the permit drain; 5 runs on one CPU All transports and kinds Mutant: 8 of 8 fail on the new assertion; real code: 5 x 8 passed 423/mutant-no-drain.txt, 423/loop-cpu0.txt

There is no QA pass: the change touches tests only. Evidence is in ~/.pickforge/investigations/ under 408, 412, 420, 423 and flakes/.

Checks on 86f30aa: oxlint, typecheck, cargo fmt --check and clippy with -D warnings; the full vitest coverage run with the desktop, window, wait, browser and viewer requirements on (191 files, 3419 passed, 4 skipped); PICKFORGE_REQUIRE_XVFB=1 cargo test --workspace --locked (328 passed). PickCheck 0.4.0 against main is clean. Sol reviewed the diff with no findings (9/10, pending the full suites, which then passed).

The HiDPI window test waits for the expanded frame, the export test and the Chrome profile test wait for killed processes to end, and the takeover drain test checks that the grant follows the sample instead of a fixed 40 ms window.
@ElbertePlinio
ElbertePlinio merged commit b75c583 into main Oct 29, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the test/timing-flakes branch October 29, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant