This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
testDelegateRegionDidChange is too fragile #1360
Comments
Says it's doing two unanimated changes when it should only be performing one.
|
I think L416's If that's correct, then this should fix it: diff --git a/test/ios/MapViewTests.m b/test/ios/MapViewTests.m
index fff52ad..08a867d 100644
--- a/test/ios/MapViewTests.m
+++ b/test/ios/MapViewTests.m
@@ -406,7 +406,7 @@
tester.mapView.centerCoordinate = CLLocationCoordinate2DMake(0, 0);
}];
- [tester waitForTimeInterval:1];
+ [tester waitForAnimationsToFinishWithTimeout:1];
XCTAssertEqual([notification.userInfo[@"animated"] boolValue],
NO,
@@ -415,6 +415,8 @@
1,
@"regionDidChange delegate should indicate one unanimated change");
+ [tester waitForTimeInterval:1];
+
notification = [system waitForNotificationName:@"regionDidChangeAnimated"
object:tester.mapView
whileExecutingBlock:^{ |
Noooope, other way around. The test is failing because it's not waiting long enough for the environment to be reset and it's catching that. |
Closed
This is looking great when testing locally and we can probably roll this into reenabling CI iOS tests in #1452. We'll give everything some care then to avoid false-positives like this one. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm seeing relatively frequent test failures, but they're not reproducible. It looks like they heavily depend on timing.
See https://travis-ci.org/mapbox/mapbox-gl-native/jobs/60350680#L1051
@incanus @1ec5
The text was updated successfully, but these errors were encountered: