ckerr

#54947: test: capture corner-smoothing pages until a frame matches

Merged
Created: Oct 14, 2026, 4:26:15 PM
Merged: Oct 14, 2026, 7:55:39 PM
5 comments
Target: main

Description of Change

The -electron-corner-smoothing reference-image tests fail intermittently. Most failures are on Linux ASan; there are a few on Windows.

The test loads the page, shows the window, waits one requestAnimationFrame and calls capturePage().
The window paints while it is still hidden and loading the page.
The frame painted for that animation frame can reach the compositor after the capture is taken. On a slow renderer, the capture then returns a frame from mid-load.

Every capture uploaded by failing CI runs shows such a frame:

  • 9 from linux-x64-asan: a partly parsed page with fewer rows.
  • 2 from Windows: the image partly or fully unpainted.

Their average difference from the reference ranges from 7.6 to 216, against a tolerance of 2.5. The corner shapes in those captures are correct.

This change captures a new frame, one animation frame apart, until the page matches the reference or 5 seconds pass.
The page is static, so the captures converge on its final rendering.

The tolerance and the reference images are unchanged:

  • A page rendered with the feature in the wrong state differs from the reference by 5.73 and still fails.
  • The tolerance comment gave 7.3 for that difference. It now gives the real figure.
  • The failure message now reports the measured difference and the number of captures taken.

Before and after on Linux, with an injected slow renderer paint and a stale frame in the surface:

  • The old recipe failed 11 of 18 tests.
  • The new one passed all 18, recovering from 6 stale captures on the next frame.

🤖 Generated with Claude Code

Checklist

Release Notes

Notes: none

Backports

42-x-y
Merged
PR Number
#54963
Merged At
Oct 14, 2026, 8:55:13 PM
Released In
Not yet
Release Date
Not yet
43-x-y
Merged
PR Number
#54968
Merged At
Oct 14, 2026, 9:27:37 PM
Released In
Not yet
Release Date
Not yet
44-x-y
Merged
PR Number
#54969
Merged At
Oct 14, 2026, 9:01:03 PM
Released In
Not yet
Release Date
Not yet
45-x-y
Merged
PR Number
#54970
Merged At
Oct 14, 2026, 9:14:59 PM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron