You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
-[MapViewTests testCompassTap] fails on iPhone 6 simulator #2920
-[MapViewTests testCompassTap] consistently fails on iPhone 6 simulator when run independently, and sometimes when run with the entire test suite (as seen pretty often on Bitrise).
The test passes consistently if I add a call to [tester waitForAnimationsToFinish] anywhere before the first call to -[MGLMapView setDirection:animated:], whether in -testCompassTap or indeed up in -beforeEach; it also passes if I make that -setDirection:animated: call non-animated.
This regression was introduced in #2769. It switched to calling -waitForAnimationsToFinish, which only knows to wait for native iOS animations. However, ever since #1829, we’ve driven the compass’ rotation by syncing its transform up with mbgl on every frame, not by using view-based animation. The only animation in play is for fading the compass, so we get lucky sometimes because KIF ends up waiting for the fade to complete.
Ideally, we’d call things like -waitForTappableViewWithAccessibilityLabel: and -waitForAbsenceOfViewWithAccessibilityLabel:, but the compass is not accessible: see #1830.
I'd like to hop on a soapbox for a moment and comment that, in general, combining CA with raw OpenGL is probably unwise. That's a blanket statement, and with any blanket statement there are exceptions, but I think that in general we should be trying to move away from using Core Animation to do any animations and do everything with OpenGL. Not only does it make cross-platform easier, but it also keeps thing simple and avoids bugs like this. I do understand that some things will always be in CA to support various end user use cases.
This is simply a case of choosing the wrong KIF API. We’re planning to move off of KIF anyhow, but your comments are reflective of what @incanus has been trying to do in #1125 (comment).
Activity
1ec5 commentedon Nov 4, 2015
This regression was introduced in #2769. It switched to calling
-waitForAnimationsToFinish, which only knows to wait for native iOS animations. However, ever since #1829, we’ve driven the compass’ rotation by syncing its transform up with mbgl on every frame, not by using view-based animation. The only animation in play is for fading the compass, so we get lucky sometimes because KIF ends up waiting for the fade to complete.Ideally, we’d call things like
-waitForTappableViewWithAccessibilityLabel:and-waitForAbsenceOfViewWithAccessibilityLabel:, but the compass is not accessible: see #1830.incanus commentedon Nov 4, 2015
Oh whoa, I didn’t know we switched that compass behavior.
adam-mapbox commentedon Nov 4, 2015
I'd like to hop on a soapbox for a moment and comment that, in general, combining CA with raw OpenGL is probably unwise. That's a blanket statement, and with any blanket statement there are exceptions, but I think that in general we should be trying to move away from using Core Animation to do any animations and do everything with OpenGL. Not only does it make cross-platform easier, but it also keeps thing simple and avoids bugs like this. I do understand that some things will always be in CA to support various end user use cases.
1ec5 commentedon Nov 4, 2015
This is simply a case of choosing the wrong KIF API. We’re planning to move off of KIF anyhow, but your comments are reflective of what @incanus has been trying to do in #1125 (comment).
[iOS] Wait for style loading, then rotation, then compass fading
[iOS] Wait for style loading, then rotation, then compass fading