Fix DesktopMode iOS screenshot late-present race (700ms -> 1500ms settle)#5316
Fix DesktopMode iOS screenshot late-present race (700ms -> 1500ms settle)#5316shai-almog wants to merge 1 commit into
Conversation
…tle) The DesktopMode capture intermittently shipped the preceding test's framebuffer (observed: it captured the MutableImageClip form) -- the documented iOS Metal late-present race where the heavy 30-row form's first frame is presented just after Display.screenshot() reads the framebuffer. The test already opts into the extraSettleBeforeCaptureMillis repaint-and-wait mitigation, but 700ms still lost the race on a starved CI runner. Raise it to the same 1500ms post-present margin the OrientationLock test already relies on. The captured form is unchanged, so the reference image is unaffected -- only the settle before the grab is longer.
|
Compared 139 screenshots: 139 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
|
Compared 131 screenshots: 131 matched. |
|
Compared 135 screenshots: 135 matched. Benchmark ResultsDetailed Performance Metrics
|
|
Compared 137 screenshots: 137 matched. |
|
Compared 137 screenshots: 137 matched. |
|
Compared 138 screenshots: 138 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 137 screenshots: 137 matched. Benchmark Results
Detailed Performance Metrics
|
|
Compared 214 screenshots: 214 matched. |
|
Compared 136 screenshots: 136 matched. |


Problem
The
DesktopModeiOS screenshot test intermittently captures the wrong form — observed in CI capturing the precedingMutableImageClipform under theDesktopModename. This is the documented iOS Metal late-present race: the heavy 30-row scrollable form's first frame is presented just afterDisplay.screenshot()reads the framebuffer, so the grab returns the previous test's pixels.It surfaced repeatedly on the device-input PR (#5309) CI as a
build-ios/packagingfailure that "cleared on re-run" — i.e. a real timing bug, not noise.Root cause
DesktopModeScreenshotTestalready opts into the sanctionedextraSettleBeforeCaptureMillis()mitigation (repaint + wait for GPU present before capture), but its 700ms value still loses the race on a starved CI runner.Fix
Raise the settle to 1500ms — the same post-present margin
OrientationLockScreenshotTestalready relies on. The captured form is unchanged, so the reference image is unaffected; only the wait before the grab is longer.🤖 Generated with Claude Code