Skip to content

Commit 9f5ffeb

Browse files
committed
More flake fixes
1 parent 7783cf6 commit 9f5ffeb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Crashlytics/UnitTests/FIRCLSContextManagerTests.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ @implementation FIRCLSContextManagerTests
4242

4343
- (void)setUp {
4444
self.fileManager = [[FIRCLSMockFileManager alloc] init];
45+
[[NSFileManager defaultManager] createDirectoryAtPath:self.fileManager.rootPath
46+
withIntermediateDirectories:YES
47+
attributes:nil
48+
error:nil];
4549
[self.fileManager createReportDirectories];
4650
[self.fileManager setupNewPathForExecutionIdentifier:TestContextReportID];
4751

Crashlytics/UnitTests/FIRCLSExistingReportManagerTests.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ - (void)setUp {
5454

5555
self.fileManager = [[FIRCLSTempMockFileManager alloc] init];
5656

57-
// Cleanup potential artifacts from other test files.
57+
// Clean up the directory and then re-create it to ensure a fresh state
5858
if ([[NSFileManager defaultManager] fileExistsAtPath:[self.fileManager rootPath]]) {
5959
assert([self.fileManager removeItemAtPath:[self.fileManager rootPath]]);
6060
}
61+
[self.fileManager createReportDirectories];
6162

6263
// Allow nil values only in tests
6364
#pragma clang diagnostic push

0 commit comments

Comments
 (0)