Skip to content

Commit 32eaa48

Browse files
authored
Attempt to fix intermittent failing Crashlytics settings tests in CI (#5107)
1 parent 3d4971b commit 32eaa48

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Crashlytics/UnitTests/FIRCLSSettingsTests.m

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
NSString *const TestGoogleAppID = @"1:test:google:app:id";
5050
NSString *const TestChangedGoogleAppID = @"2:changed:google:app:id";
5151

52+
@interface FIRCLSSettings (Testing)
53+
54+
@property(nonatomic, strong) NSDictionary<NSString *, id> *settingsDictionary;
55+
56+
@end
57+
5258
@interface FIRCLSSettingsTests : XCTestCase
5359

5460
@property(nonatomic, retain) FIRCLSMockFileManager *fileManager;
@@ -75,6 +81,10 @@ - (void)setUp {
7581
_settings = [[FIRCLSSettings alloc] initWithFileManager:_fileManager appIDModel:_appIDModel];
7682
}
7783

84+
- (void)tearDown {
85+
[_fileManager removeContentsOfDirectoryAtPath:_fileManager.settingsDirectoryPath];
86+
}
87+
7888
- (void)testDefaultSettings {
7989
XCTAssertEqual(self.settings.isCacheExpired, YES);
8090

@@ -431,8 +441,10 @@ - (void)testNewReportEndpointSettings {
431441
[self writeSettings:settingsJSON error:&error];
432442
NSTimeInterval currentTimestamp = [NSDate timeIntervalSinceReferenceDate];
433443
[self.settings cacheSettingsWithGoogleAppID:TestGoogleAppID currentTimestamp:currentTimestamp];
434-
435444
XCTAssertNil(error, "%@", error);
445+
446+
XCTAssertNotNil(self.settings.settingsDictionary);
447+
NSLog(@"[Debug Log] %@", self.settings.settingsDictionary);
436448
XCTAssertTrue(self.settings.shouldUseNewReportEndpoint);
437449
}
438450

0 commit comments

Comments
 (0)