Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

-[MapViewTests testCompassTap] fails on iPhone 6 simulator #2920

Closed
1ec5 opened this issue Nov 3, 2015 · 4 comments
Closed

-[MapViewTests testCompassTap] fails on iPhone 6 simulator #2920

1ec5 opened this issue Nov 3, 2015 · 4 comments
Assignees
Labels
bug iOS Mapbox Maps SDK for iOS tests
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Nov 3, 2015

-[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.

/cc @incanus @friedbunny

@1ec5
Copy link
Contributor Author

1ec5 commented 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.

@1ec5 1ec5 self-assigned this Nov 4, 2015
@incanus
Copy link
Contributor

incanus commented Nov 4, 2015

Oh whoa, I didn’t know we switched that compass behavior.

@adam-mapbox
Copy link
Contributor

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
Copy link
Contributor Author

1ec5 commented 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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug iOS Mapbox Maps SDK for iOS tests
Projects
None yet
Development

No branches or pull requests

3 participants