Skip to content

Commit abfeddf

Browse files
committed
Restoring the first delay in the test
1 parent c418948 commit abfeddf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Tests/Unit-Tests/NewRelicAgentTests/Uncategorized/NRLoggerTests.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,18 @@ - (void) testAutoCollectedLogs {
262262
[NRLogger setRemoteLogLevel:NRLogLevelDebug];
263263
[NRAutoLogCollector redirectStandardOutputAndError];
264264

265+
XCTestExpectation *delayExpectation1 = [self expectationWithDescription:@"Waiting for Log Queue"];
266+
267+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
268+
[delayExpectation1 fulfill];
269+
});
270+
271+
[self waitForExpectationsWithTimeout:5 handler:^(NSError * _Nullable error) {
272+
if (error) {
273+
XCTFail(@"Timeout error");
274+
}
275+
}];
276+
265277
// Three messages should reach the remote log file for upload.
266278
NSLog(@"NSLog Test \n\n");
267279
os_log_t customLog = os_log_create("com.agent.tests", "logTest");

0 commit comments

Comments
 (0)