1919#import " Crashlytics/Crashlytics/Components/FIRCLSGlobals.h"
2020#import " Crashlytics/Crashlytics/Helpers/FIRCLSFile.h"
2121#import " Crashlytics/Crashlytics/Models/FIRCLSInternalReport.h"
22+ #import " Crashlytics/Crashlytics/Private/FIRCLSInternalReport_Private.h"
2223#import " Crashlytics/Crashlytics/Private/FIRCrashlyticsReport_Private.h"
2324#import " Crashlytics/Crashlytics/Public/FirebaseCrashlytics/FIRCrashlyticsReport.h"
2425
@@ -244,6 +245,7 @@ - (void)testCustomKeysLimits {
244245 NSString *key = [NSString stringWithFormat: @" key_%i " , i];
245246 [report setCustomValue: @" hello" forKey: key];
246247 }
248+ [report.internalReport.operationQueue waitUntilAllOperationsAreFinished ];
247249
248250 NSArray *entriesI = FIRCLSFileReadSections (
249251 [[report.internalReport pathForContentFile: FIRCLSReportUserIncrementalKVFile]
@@ -265,6 +267,7 @@ - (void)testLogsNoExisting {
265267
266268 [report log: @" Normal log without formatting" ];
267269 [report logWithFormat: @" %@ , %@ " , @" First" , @" Second" ];
270+ [report.internalReport.operationQueue waitUntilAllOperationsAreFinished ];
268271
269272 NSArray *entries = FIRCLSFileReadSections (
270273 [[report.internalReport pathForContentFile: FIRCLSReportLogAFile] fileSystemRepresentation ],
@@ -283,6 +286,7 @@ - (void)testLogsWithExisting {
283286
284287 [report log: @" Normal log without formatting" ];
285288 [report logWithFormat: @" %@ , %@ " , @" First" , @" Second" ];
289+ [report.internalReport.operationQueue waitUntilAllOperationsAreFinished ];
286290
287291 NSArray *entries = FIRCLSFileReadSections (
288292 [[report.internalReport pathForContentFile: FIRCLSReportLogAFile] fileSystemRepresentation ],
@@ -302,6 +306,7 @@ - (void)testLogLimits {
302306 for (int i = 0 ; i < 2000 ; i++) {
303307 [report log: @" 0123456789" ];
304308 }
309+ [report.internalReport.operationQueue waitUntilAllOperationsAreFinished ];
305310
306311 unsigned long long sizeA = [[[NSFileManager defaultManager ]
307312 attributesOfItemAtPath: [report.internalReport pathForContentFile: FIRCLSReportLogAFile]
0 commit comments