Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Crashlytics/Crashlytics/Models/FIRCLSSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,15 @@ - (NSDictionary *)loadCacheKey {

- (void)deleteCachedSettings {
__weak FIRCLSSettings *weakSelf = self;
#ifndef FIREBASE_IS_NIGHTLY_TESTING
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
#endif
__strong FIRCLSSettings *strongSelf = weakSelf;
if ([strongSelf.fileManager fileExistsAtPath:strongSelf.fileManager.settingsFilePath]) {
[strongSelf.fileManager removeItemAtPath:strongSelf.fileManager.settingsFilePath];
}
if ([strongSelf.fileManager fileExistsAtPath:strongSelf.fileManager.settingsCacheKeyPath]) {
[strongSelf.fileManager removeItemAtPath:strongSelf.fileManager.settingsCacheKeyPath];
}
#ifndef FIREBASE_IS_NIGHTLY_TESTING
});
#endif

@synchronized(self) {
self.isCacheKeyExpired = YES;
Expand Down
5 changes: 5 additions & 0 deletions Crashlytics/UnitTests/FIRCLSSettingsTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
- (void)setUp {
[super setUp];

dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
// Drain queue to prevent interference from previous tests.
// This queue is used by `- [FIRCLSSettings deleteCachedSettings]`.
});

_fileManager = [[FIRCLSMockFileManager alloc] init];

_appIDModel = [[FABMockApplicationIdentifierModel alloc] init];
Expand Down Expand Up @@ -134,7 +139,7 @@

[self.settings cacheSettingsWithGoogleAppID:googleAppID currentTimestamp:currentTimestamp];

[self waitForExpectations:@[ self.fileManager.removeExpectation ] timeout:1];

Check failure on line 142 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-26, Xcode_26.1, iOS)

testCorruptCache, Asynchronous wait failed: Exceeded timeout of 1 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.cache".

Check failure on line 142 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-26, Xcode_26.1, iOS)

testCorruptCache, Asynchronous wait failed: Exceeded timeout of 1 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.cache".

Check failure on line 142 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-14, Xcode_16.2, iOS)

testCorruptCache, Asynchronous wait failed: Exceeded timeout of 1 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.cache".

Check failure on line 142 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-14, Xcode_16.2, iOS)

testCorruptCache, Asynchronous wait failed: Exceeded timeout of 1 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.cache".

Check failure on line 142 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-14, Xcode_16.2, iOS)

testCorruptCache, Asynchronous wait failed: Exceeded timeout of 1 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.cache".

Check failure on line 142 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, visionOS)

testCorruptCache, Asynchronous wait failed: Exceeded timeout of 1 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.cache".
}

- (void)reloadFromCacheWithGoogleAppID:(NSString *)googleAppID
Expand All @@ -147,7 +152,7 @@

[self.settings reloadFromCacheWithGoogleAppID:googleAppID currentTimestamp:currentTimestamp];

[self waitForExpectations:@[ self.fileManager.removeExpectation ] timeout:5.0];

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-26, Xcode_26.1, iOS)

testGoogleAppIDChanged, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-26, Xcode_26.1, iOS)

testCorruptCacheKey, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-26, Xcode_26.1, iOS)

testActivatedSettingsMissingCacheKey, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-26, Xcode_26.1, iOS)

testGoogleAppIDChanged, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-26, Xcode_26.1, iOS)

testCorruptCacheKey, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-26, Xcode_26.1, iOS)

testGoogleAppIDChanged, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-26, Xcode_26.1, iOS)

testCorruptCacheKey, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-26, Xcode_26.1, iOS)

testActivatedSettingsMissingCacheKey, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-14, Xcode_16.2, iOS)

testActivatedSettingsMissingCacheKey, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-14, Xcode_16.2, iOS)

testActivatedSettingsMissingCacheKey, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-14, Xcode_16.2, iOS)

testGoogleAppIDChanged, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-14, Xcode_16.2, iOS)

testCorruptCacheKey, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-14, Xcode_16.2, iOS)

testActivatedSettingsMissingCacheKey, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, visionOS)

testCorruptCacheKey, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".

Check failure on line 155 in Crashlytics/UnitTests/FIRCLSSettingsTests.m

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, visionOS)

testActivatedSettingsMissingCacheKey, Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "FIRCLSMockFileManager.removeExpectation.reload".
}

- (void)testActivatedSettingsCached {
Expand Down
Loading