fix(SnapshotKitTesting): stabilize async snapshots on slow CI - #232
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
onReadyToMeasureseam for deterministic intrinsic/full-content readiness, with cancellation-aware timeout handling and distinct timing attributionWhy
The shard-2 failure on #227 showed
FlyoverCanvas_iPadstill changing after its four-second settle budget. Pixel settling is only a proxy for async readiness: on slower hosted runners, Flyover's serial preview builders could still be resolving when intrinsic measurement or capture began. Broadly increasing all waits would make failures slower without proving the intended content had loaded.This change gives height-changing async content a deterministic pre-measure seam, uses Flyover's production loading lifecycle as that signal, and reserves the CI multiplier for genuine runner slowness at maximum ceilings only.
Review focus
SnapshotMeasurementHookraces the hosted hook against the effective capture ceiling and relies on hook implementations cooperating with cancellation.FlyoverPreviewReadinesstracks active load identity separately from the latest viewport expectation so early completions count, stale completions do not, and cancellation resumes every waiter exactly once.Testing
./swiftformat --lintbash -n test./test SnapshotKitTests SnapshotKitTestingTests FlyoverTests— 117 tests passed./test FlyoverTests— 36 tests passed after the final active-load hardening./test --snapshots --only 'FlyoverSnapshotTests/FlyoverSnapshotTests/canvasAndList()'— five consecutive runs passed against the pushed commitSNAPSHOT_SETTLE_TIMEOUT_MULTIPLIER=2 ./test --snapshots --snapshot-shard 2/2— 22 snapshot tests passed