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

Commit

Permalink
[ios, tests] Bump most waitForExpectationsWithTimeout's to 5s
Browse files Browse the repository at this point in the history
[skip firebase]
  • Loading branch information
friedbunny committed Sep 18, 2018
1 parent 7ec3875 commit 5882c1a
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion platform/darwin/test/MGLDocumentationExampleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate {
mapView = MGLMapView(frame: CGRect(x: 0, y: 0, width: 256, height: 256), styleURL: MGLDocumentationExampleTests.styleURL)
mapView.delegate = self
styleLoadingExpectation = expectation(description: "Map view should finish loading style")
waitForExpectations(timeout: 1, handler: nil)
waitForExpectations(timeout: 5, handler: nil)
}

override func tearDown() {
Expand Down
2 changes: 1 addition & 1 deletion platform/darwin/test/MGLDocumentationGuideTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate {
mapView = MGLMapView(frame: CGRect(x: 0, y: 0, width: 256, height: 256), styleURL: styleURL)
mapView.delegate = self
styleLoadingExpectation = expectation(description: "Map view should finish loading style")
waitForExpectations(timeout: 1, handler: nil)
waitForExpectations(timeout: 5, handler: nil)
}

override func tearDown() {
Expand Down
10 changes: 5 additions & 5 deletions platform/darwin/test/MGLOfflineStorageTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ - (void)testAddPackForBounds {
pack = completionHandlerPack;
[additionCompletionHandlerExpectation fulfill];
}];
[self waitForExpectationsWithTimeout:2 handler:nil];
[self waitForExpectationsWithTimeout:5 handler:nil];

XCTAssertEqual([MGLOfflineStorage sharedOfflineStorage].packs.count, countOfPacks + 1, @"Added pack should have been added to the canonical collection of packs owned by the shared offline storage object. This assertion can fail if this test is run before -testAAALoadPacks.");

Expand Down Expand Up @@ -124,7 +124,7 @@ - (void)testAddPackForBounds {
return notificationPack == pack && pack.state == MGLOfflinePackStateInactive;
}];
[pack requestProgress];
[self waitForExpectationsWithTimeout:1 handler:nil];
[self waitForExpectationsWithTimeout:5 handler:nil];
}

- (void)testAddPackForGeometry {
Expand Down Expand Up @@ -157,7 +157,7 @@ - (void)testAddPackForGeometry {
pack = completionHandlerPack;
[additionCompletionHandlerExpectation fulfill];
}];
[self waitForExpectationsWithTimeout:2 handler:nil];
[self waitForExpectationsWithTimeout:5 handler:nil];

XCTAssertEqual([MGLOfflineStorage sharedOfflineStorage].packs.count, countOfPacks + 1, @"Added pack should have been added to the canonical collection of packs owned by the shared offline storage object. This assertion can fail if this test is run before -testAAALoadPacks.");

Expand Down Expand Up @@ -195,7 +195,7 @@ - (void)testAddPackForGeometry {
return notificationPack == pack && pack.state == MGLOfflinePackStateInactive;
}];
[pack requestProgress];
[self waitForExpectationsWithTimeout:1 handler:nil];
[self waitForExpectationsWithTimeout:5 handler:nil];
pack = nil;
}

Expand Down Expand Up @@ -239,7 +239,7 @@ - (void)testRemovePack {
XCTAssertEqual(pack.state, MGLOfflinePackStateInvalid, @"Removed pack should be invalid in the completion handler.");
[completionHandlerExpectation fulfill];
}];
[self waitForExpectationsWithTimeout:1 handler:nil];
[self waitForExpectationsWithTimeout:5 handler:nil];

XCTAssertEqual(pack.state, MGLOfflinePackStateInvalid, @"Removed pack should have been invalidated synchronously.");

Expand Down
2 changes: 1 addition & 1 deletion platform/darwin/test/MGLStyleTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ - (void)setUp {
self.mapView.delegate = self;
if (!self.mapView.style) {
_styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."];
[self waitForExpectationsWithTimeout:1 handler:nil];
[self waitForExpectationsWithTimeout:5 handler:nil];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ - (void)waitForCollisionDetectionToRun {
[timerExpired fulfill];
});

[self waitForExpectations:@[timerExpired, self.renderFinishedExpectation] timeout:1.0];
[self waitForExpectations:@[timerExpired, self.renderFinishedExpectation] timeout:5];
}

@end
2 changes: 1 addition & 1 deletion platform/ios/Integration Tests/MBGLIntegrationTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ - (void)testOpenGLLayerDoesNotLeakWhenMapViewDeallocs {
XCTAssertNil(mapView2.style);

self.styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."];
[self waitForExpectationsWithTimeout:1 handler:nil];
[self waitForExpectationsWithTimeout:5 handler:nil];

MGLOpenGLStyleLayer *layer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"];
weakLayer = layer;
Expand Down
14 changes: 7 additions & 7 deletions platform/ios/Integration Tests/MGLCameraTransitionTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ - (void)testSetAndResetNorthWithDispatchAsyncInDelegateMethod {
[self.mapView setDirection:90 animated:YES];

// loop, render, and wait
[self waitForExpectations:@[expectation] timeout:1.5];
[self waitForExpectations:@[expectation] timeout:5];
}


Expand Down Expand Up @@ -62,7 +62,7 @@ - (void)testSetAndResetNorthInDelegateMethod {
};

[self.mapView setDirection:90 animated:YES];
[self waitForExpectations:@[expectation] timeout:1.5];
[self waitForExpectations:@[expectation] timeout:5];
}

- (void)testInterruptingAndResetNorthOnlyOnceInIsChanging {
Expand Down Expand Up @@ -106,7 +106,7 @@ - (void)testInterruptingAndResetNorthOnlyOnceInIsChanging {
};

[self.mapView setDirection:90 animated:YES];
[self waitForExpectations:@[expectation] timeout:1.5];
[self waitForExpectations:@[expectation] timeout:5];

XCTAssertEqualWithAccuracy(self.mapView.direction, 0.0, 0.001, @"Camera should have reset to north. %0.3f", self.mapView.direction);
}
Expand Down Expand Up @@ -222,7 +222,7 @@ - (void)testSetCenterCoordinateInDelegateMethod {

// Should take MGLAnimationDuration seconds (0.3)
[self.mapView setCenterCoordinate:target zoomLevel:15.0 animated:YES];
[self waitForExpectations:@[expectation] timeout:1.5];
[self waitForExpectations:@[expectation] timeout:5];
}

- (void)testFlyToCameraInDelegateMethod {
Expand Down Expand Up @@ -323,7 +323,7 @@ - (void)testFlyToCameraInDelegateMethod {
// Should take MGLAnimationDuration
[self.mapView setCenterCoordinate:target zoomLevel:zoomLevel animated:YES];

[self waitForExpectations:@[expectation] timeout:2.0];
[self waitForExpectations:@[expectation] timeout:5];

NSLog(@"setCenterCoordinate: %0.4fs", stop1 - stop0);
NSLog(@"flyToCamera: %0.4fs", stop2 - stop1);
Expand Down Expand Up @@ -362,7 +362,7 @@ - (void)testContinuallyResettingNorthInIsChangingPENDING {
};

[self.mapView setDirection:90 animated:YES];
[self waitForExpectations:@[expectation] timeout:1.5];
[self waitForExpectations:@[expectation] timeout:5];

XCTAssertEqualWithAccuracy(self.mapView.direction, 0.0, 0.001, @"Camera should have reset to north. %0.3f", self.mapView.direction);
}
Expand All @@ -389,7 +389,7 @@ - (void)testContinuallySettingCoordinateInIsChangingPENDING {
};

[self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(40.0, 40.0) animated:YES];
[self waitForExpectations:@[expectation] timeout:1.5];
[self waitForExpectations:@[expectation] timeout:5];

XCTAssertEqualWithAccuracy(self.mapView.direction, 0.0, 0.001, @"Camera should have reset to north. %0.3f", self.mapView.direction);
}
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/Integration Tests/MGLMapViewIntegrationTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ - (void)setUp {
[window makeKeyAndVisible];

if (!self.mapView.style) {
[self waitForMapViewToFinishLoadingStyleWithTimeout:1];
[self waitForMapViewToFinishLoadingStyleWithTimeout:5];
}
}

Expand Down
2 changes: 1 addition & 1 deletion platform/ios/test/MGLAnnotationViewTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ - (void)testAnnotationView
MGLTestAnnotation *annotation = [[MGLTestAnnotation alloc] init];
[_mapView addAnnotation:annotation];

[self waitForExpectationsWithTimeout:1 handler:nil];
[self waitForExpectationsWithTimeout:5 handler:nil];

XCTAssert(_mapView.annotations.count == 1, @"number of annotations should be 1");
XCTAssertNotNil(_annotationView.annotation, @"annotation property should not be nil");
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/test/MGLMapViewLayoutTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ - (void)setUp {
[self.superView addConstraints:[verticalConstraints arrayByAddingObjectsFromArray:horizonatalConstraints]];

self.styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."];
[self waitForExpectationsWithTimeout:1 handler:nil];
[self waitForExpectationsWithTimeout:5 handler:nil];

self.mapView.showsScale = YES;

Expand Down

0 comments on commit 5882c1a

Please sign in to comment.