You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
screenshot-wait-live pixel-change wait times out under heavy CPU load #193
Found while verifying the fix for #191 under artificial CPU load (32 busy loops on 16 CPUs with the tests niced to 15, load average up to 51). In one of six loaded runs of packages/desktop-linux/test/screenshot-wait-live.test.ts on the marker mechanism, the launch and the window wait both succeeded (the "Wait Live" zenity window was found), and then the final desktopWait with mode changed against the first screenshot returned timeout instead of changed within its 5 s budget. The other five loaded runs and all unloaded runs passed. The launch-grace assertions fixed in #191 were not involved.
Likely mechanism: each sample of a changed wait takes a screenshot with ImageMagick import, which is slow under starvation, so few samples fit in 5 s, and the freshly mapped zenity window may not have painted yet in the first of them. Unverified.
Reproduce under load and record how many samples the 5 s changed wait managed and when the window first painted.
Decide whether the test should wait on the window's paint rather than a fixed 5 s pixel-change budget, without relaxing the change detection itself.
Keep the unloaded timing strict; no retries or skips.
Reproduced under the #191 load recipe (32 busy loops at nice 10, test at nice 15) on 16 CPUs with maim as the screenshot tool.
Sampling rate is not the limiter. Under load each sample costs 200 to 450 ms, so 8 to 17 samples fit in the 5 s budget (5 to 11 at load 30 to 45). Unloaded a sample costs about 20 ms.
The gap is between map and paint. xdotool search --onlyvisible lists the zenity window as soon as it is mapped: 380 ms after launch unloaded, 1.7 to 6 s under load. GTK's first frame lands about 250 ms after that unloaded, but 6.5 s after it in the loaded run that timed out (paint 8.6 s after launch), and more than 10 s after launch in all four runs at load 30 to 45. The 5 s changed budget was a bound on a starved GTK paint, not on change detection.
Decision: the pixel-change wait is the paint wait, so keep it and bound it by the window's lifetime instead of a fixed 5 s. PR #198 keeps zenity alive 30 s, gives the changed wait 20 s, and raises the test timeout to 60 s. Detection, the stable wait and the 400 ms timeout assertion are unchanged; unloaded the test still finishes in about 1.8 s. Loaded vitest: 6/6 pass (load 11 to 32). Probe script and per-sample logs are kept under ~/.pickforge/investigations/193.
Activity
ElbertePlinio commentedon Sep 23, 2026
Reproduced under the #191 load recipe (32 busy loops at nice 10, test at nice 15) on 16 CPUs with maim as the screenshot tool.
Sampling rate is not the limiter. Under load each sample costs 200 to 450 ms, so 8 to 17 samples fit in the 5 s budget (5 to 11 at load 30 to 45). Unloaded a sample costs about 20 ms.
The gap is between map and paint.
xdotool search --onlyvisiblelists the zenity window as soon as it is mapped: 380 ms after launch unloaded, 1.7 to 6 s under load. GTK's first frame lands about 250 ms after that unloaded, but 6.5 s after it in the loaded run that timed out (paint 8.6 s after launch), and more than 10 s after launch in all four runs at load 30 to 45. The 5 s changed budget was a bound on a starved GTK paint, not on change detection.Decision: the pixel-change wait is the paint wait, so keep it and bound it by the window's lifetime instead of a fixed 5 s. PR #198 keeps zenity alive 30 s, gives the changed wait 20 s, and raises the test timeout to 60 s. Detection, the stable wait and the 400 ms timeout assertion are unchanged; unloaded the test still finishes in about 1.8 s. Loaded vitest: 6/6 pass (load 11 to 32). Probe script and per-sample logs are kept under
~/.pickforge/investigations/193.test(desktop): bound the screenshot wait paint budget by the window l…