#55937: test: wait for the OSR image before capturing a shared texture frame
Merged
Description of Change
Follow-up to #55784. api-shared-texture.spec.ts flaked again on main's macOS arm64 MAS shard (failed job).
Two fixes:
- Blank frame race. The offscreen page's
loadevent can fire before its image is actually drawn, sostartPainting()sometimes captured a blank white frame and the pixel check failed. I reproduced this on an arm64 Mac by running the spec in a loop under CPU load: 5 of 10 runs failed. The test now waits for the image to decode and render before it captures. With that change, 15 of 15 runs passed. - Better timeout errors. The CI failure was a bare 30s test timeout. Each step had its own 20s deadline, so if one step was slow and a later one hung, the test timed out before either deadline fired, and we couldn't tell which step stalled. Step deadlines now fit inside the test timeout. A stall now reports which step hung and how long the earlier ones took.
capturePage()also gets its own deadline now.
I can't be sure the blank frame race caused the CI timeout. If it shows up again, the error will say which step hung.
Refs #55391
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
-
npm testpasses - tests are changed or added
- PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, past tense, and no longer than 80 characters.
Release Notes
Notes: none
Backports
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