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

Commit

Permalink
[test,ios] Disable multiple mapsnapshotter test.
Browse files Browse the repository at this point in the history
8 simultaneous mapsnapshotter test periodically deadlocks in simulator.
Also, increase timeouts to decrease chance of spurious test failure.
  • Loading branch information
ChrisLoer committed Jun 1, 2018
1 parent 501a819 commit 4f1360c
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,11 @@ - (void)testAllocatingSnapshotOnBackgroundQueue {
[self waitForExpectations:@[expectation] timeout:2.0];
}

- (void)testMultipleSnapshottersFromBackgroundQueue {
- (void)testSnapshotterFromBackgroundQueue {
if (!validAccessToken()) {
return;
}

// Crashes with only 1 snapshot
CGSize size = self.mapView.bounds.size;
CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(30.0, 30.0);

Expand Down Expand Up @@ -145,10 +144,9 @@ - (void)testMultipleSnapshottersFromBackgroundQueue {
MGLTestAssertNotNil(strongself, snapshot.image);
MGLTestAssertNil(strongself, error, @"Snapshot should not error with: %@", error);

// Change this back to XCTAttachmentLifetimeDeleteOnSuccess when we're sure this
// test is passing.
// Change this to XCTAttachmentLifetimeKeepAlways to be able to look at the snapshots after running
XCTAttachment *attachment = [XCTAttachment attachmentWithImage:snapshot.image];
attachment.lifetime = XCTAttachmentLifetimeKeepAlways;
attachment.lifetime = XCTAttachmentLifetimeDeleteOnSuccess;
[strongself addAttachment:attachment];

dispatch_group_leave(group);
Expand All @@ -174,10 +172,11 @@ - (void)testMultipleSnapshottersFromBackgroundQueue {
});
});

[self waitForExpectations:@[expectation] timeout:10.0];
[self waitForExpectations:@[expectation] timeout:60.0];
}

- (void)testMultipleSnapshotters {
- (void)testMultipleSnapshottersPENDING {
MGL_CHECK_IF_PENDING_TEST_SHOULD_RUN();
if (!validAccessToken()) {
return;
}
Expand Down Expand Up @@ -217,10 +216,9 @@ - (void)testMultipleSnapshotters {
MGLTestAssertNotNil(strongself, snapshot.image);
MGLTestAssertNil(strongself, error, @"Snapshot should not error with: %@", error);

// Change this back to XCTAttachmentLifetimeDeleteOnSuccess when we're sure this
// test is passing.
// Change this to XCTAttachmentLifetimeKeepAlways to be able to look at the snapshots after running
XCTAttachment *attachment = [XCTAttachment attachmentWithImage:snapshot.image];
attachment.lifetime = XCTAttachmentLifetimeKeepAlways;
attachment.lifetime = XCTAttachmentLifetimeDeleteOnSuccess;
[strongself addAttachment:attachment];

// Dealloc the snapshotter (by having this line in the block, we
Expand All @@ -233,7 +231,7 @@ - (void)testMultipleSnapshotters {
}];
} // end for loop

[self waitForExpectations:@[expectation] timeout:20.0];
[self waitForExpectations:@[expectation] timeout:60.0];
}

@end

0 comments on commit 4f1360c

Please sign in to comment.