Speed up unnecessarily and unintentionally slow waitForAnimationsToFinish
calls
#1301
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.
We identified 3 issues where calls to
waitForAnimationsToFinish
would wait longer than we'd expect:KIFTouchVisualizerView
was added to show where touch events are happening, but they animate in a separate window and have an alpha fade for .75s. Every tap action then will wait for a minimum of .75s after the tap for that animation to complete, which was unintentional. Credit to @amorde for finding and testing this issue.This does alter test timing slightly, and even if your code doesn't explicitly use
waitForAnimationsToFinish
, it is also called automatically called after UI actions, such as tapping the screen. If you have tweaked the timeouts to be faster and more aggressive, you might encounter some race conditions. You might be able to work around some of this temporarily by increasing theKIFTestStepDefaultAnimationStabilizationTimeout
to .75s or 1s, but that will also slow down the execution of all of your tests (likely back to the speed before this change lands).This change has turned up quite a few race conditions in our tests, but nothing that seemed like it wasn't something that shouldn't have more explicit validation of the screen state.
I recommend reviewing this with whitespace diffs ignored.
CC: @amorde @dnkoutso