Repository navigation
test(e2e): stabilise waitForAnimationToEnd by animating the demo app on every frame - #3760
Open
Fishbowler wants to merge 2 commits into
Open
Fishbowler wants to merge 2 commits into
Fishbowler wants to merge 2 commits into
Conversation
waitForAnimationToEnd takes two screenshots back to back and treats the screen as settled when they match. The Animation Test screen's countdown and globes change only every 100-125ms, so on a fast emulator both screenshots often land between changes and the wait returns while the animation is still running. Run alone, the flow passed 1 in 8 on API 33 and 2 in 8 on API 34. Add a block that slides across a track on every frame while the animation runs, positioned from the controller's time-based value so a dropped frame still moves it. It is hidden when idle, so the no-animation case stays static, and excluded from semantics, so the view hierarchy is unchanged. Run alone 10 times each, the flow now passes 10/10 on API 33, 34 and 36, as does extendedWaitUntil, which uses the same screen.
The sliding block now makes waitForAnimationToEnd reliable on its own. The moon-phase globes and the milliseconds counter only existed to make the screen change, did so too slowly to help, and no flow refers to them. The countdown stays: extendedWaitUntil waits for "0.0s". Run alone 10 times on API 34, waitForAnimationToEnd passes 10/10, as does extendedWaitUntil.
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.
Why
The
waitForAnimationToEnde2e flow fails intermittently on Android, ending the wait while the demo app's animation is still running. Run on its own on a local emulator, it passed 1 in 8 on API 33 and 2 in 8 on API 34, and it failed on every level from 34 to 37 in full-suite runs. CI on API 32 hasn't shown it, but only because its slower emulator hides the race; it stands in the way of moving CI to a newer Android version.Approach
waitForAnimationToEndtakes two screenshots back to back and treats the screen as settled when they match. The Animation Test screen's countdown and globes change only every 100–125ms, so on a fast emulator both screenshots often land between changes.The globes and the milliseconds counter are replaced by a block that slides across a track on every frame while the animation runs. Its position comes from the animation controller's time-based value, so a dropped frame still moves it. It is hidden when idle, so the flow's no-animation check still sees a static screen, and it is excluded from semantics, so the view hierarchy is unchanged. The countdown stays, because
extendedWaitUntil.yamlwaits for it to reach0.0s. Maestro itself is unchanged.Verification
On arm64 emulators configured like CI's (4 cores, 4192 MB, swiftshader, 606×1280), with a fresh demo app build,
commands/waitForAnimationToEnd.yamlrun alone 10 times on each level:commands/extendedWaitUntil.yaml, which uses the same screen, passed on each. After removing the globes and counter, both flows were rerun on API 34: 10/10 and a pass. Not run on iOS.