Skip to content

test(desktop): bound the screenshot wait paint budget by the window lifetime - #198

Merged
ElbertePlinio merged 3 commits into
mainfrom
fix/193-changed-wait-budget
Sep 24, 2026
Merged

ElbertePlinio merged 3 commits into
mainfrom
fix/193-changed-wait-budget

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

Closes #193

Under the #191 load recipe (32 busy loops at nice 10, tests at nice 15) the final changed wait in screenshot-wait-live.test.ts timed out in 1 of 6 instrumented runs and 4 of 4 real runs. The issue's hypothesis was that too few samples fit in 5 s. Measured: 8 to 17 samples fit. The real cause is that xdotool search --onlyvisible lists the zenity window as soon as it is mapped, while GTK paints its first frame about 250 ms later unloaded and 6 s or more later when zenity is starved. The 5 s budget bounded a starved GTK paint, not change detection.

Change (test only): zenity window lifetime 30 s, pixel-change wait 20 s of that lifetime, test timeout 60 s. The change detection, the stable wait, and the 400 ms timeout assertion are unchanged, and unloaded the wait still returns at the first changed sample (test still runs in about 1.8 s).

Verification

  • unloaded vitest: 3/3 pass, ~1.8 s each
  • loaded vitest (load 11 to 32): 6/6 pass, 6.8 to 11.6 s each
  • oxlint, tsc, pickcheck clean

Evidence and probe script under ~/.pickforge/investigations/193 (not committed).

…ifetime

Under heavy CPU load the final changed wait in screenshot-wait-live timed
out even though 8 to 17 samples fit in its 5 s budget. xdotool lists the
zenity window as soon as it is mapped, while GTK paints its first frame
250 ms later unloaded and 6 s or more later when zenity is starved, so the
5 s budget bounded a starved paint rather than change detection.

Keep the zenity window alive for 30 s and give the pixel-change wait 20 s
of that lifetime. Unloaded the wait still returns at the first changed
sample; the stable and 400 ms timeout assertions stay strict.

Closes #193
@ElbertePlinio

Copy link
Copy Markdown
Member Author

The first run on c6e6fa0 failed in the coverage step at the window wait (xdotool search failed on :90: Can't open display), 9.2 s into the test, which is before the pixel-change wait this PR changes. The same test passed in the plain test step of that job and on the previous run of the same code. Filed as #201 and reran the job.

@ElbertePlinio
ElbertePlinio merged commit 719b374 into main Sep 24, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/193-changed-wait-budget branch September 24, 2026 20:20
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.

screenshot-wait-live pixel-change wait times out under heavy CPU load

1 participant