@@ -68,18 +68,6 @@ - (void) tearDown
68
68
69
69
- (void ) testNRLogger {
70
70
71
- XCTestExpectation *delayExpectation1 = [self expectationWithDescription: @" Waiting for Log Queue" ];
72
-
73
- dispatch_after (dispatch_time (DISPATCH_TIME_NOW, (int64_t )(2 * NSEC_PER_SEC)), dispatch_get_main_queue (), ^{
74
- [delayExpectation1 fulfill ];
75
- });
76
-
77
- [self waitForExpectationsWithTimeout: 5 handler: ^(NSError * _Nullable error) {
78
- if (error) {
79
- XCTFail (@" Timeout error" );
80
- }
81
- }];
82
-
83
71
[NewRelic logInfo: @" Info Log..." ];
84
72
[NewRelic logError: @" Error Log..." ];
85
73
[NewRelic logVerbose: @" Verbose Log..." ];
@@ -93,20 +81,9 @@ - (void) testNRLogger {
93
81
@" additionalAttribute2" : @" attribute2"
94
82
}];
95
83
96
- XCTestExpectation *delayExpectation2 = [self expectationWithDescription: @" Waiting for Log Queue" ];
97
-
98
- dispatch_after (dispatch_time (DISPATCH_TIME_NOW, (int64_t )(2 * NSEC_PER_SEC)), dispatch_get_main_queue (), ^{
99
- [delayExpectation2 fulfill ];
100
- });
101
-
102
- [self waitForExpectationsWithTimeout: 5 handler: ^(NSError * _Nullable error) {
103
- if (error) {
104
- XCTFail (@" Timeout error" );
105
- }
106
- }];
84
+ sleep (5 );
107
85
108
86
NSError * error;
109
- NSString *path = [NRLogger logFilePath ];
110
87
NSData * logData = [NRLogger logFileData: &error];
111
88
if (error){
112
89
NSLog (@" %@ " , error.localizedDescription );
@@ -174,17 +151,7 @@ - (void) testRemoteLogLevels {
174
151
// Set the remote log level to Debug.
175
152
[NRLogger setRemoteLogLevel: NRLogLevelDebug];
176
153
177
- XCTestExpectation *delayExpectation1 = [self expectationWithDescription: @" Waiting for Log Queue" ];
178
-
179
- dispatch_after (dispatch_time (DISPATCH_TIME_NOW, (int64_t )(2 * NSEC_PER_SEC)), dispatch_get_main_queue (), ^{
180
- [delayExpectation1 fulfill ];
181
- });
182
-
183
- [self waitForExpectationsWithTimeout: 5 handler: ^(NSError * _Nullable error) {
184
- if (error) {
185
- XCTFail (@" Timeout error" );
186
- }
187
- }];
154
+ sleep (1 );
188
155
189
156
// Seven messages should reach the remote log file for upload.
190
157
@@ -201,17 +168,7 @@ - (void) testRemoteLogLevels {
201
168
@" additionalAttribute2" : @" attribute2"
202
169
}];
203
170
204
- XCTestExpectation *delayExpectation2 = [self expectationWithDescription: @" Waiting for Log Queue" ];
205
-
206
- dispatch_after (dispatch_time (DISPATCH_TIME_NOW, (int64_t )(2 * NSEC_PER_SEC)), dispatch_get_main_queue (), ^{
207
- [delayExpectation2 fulfill ];
208
- });
209
-
210
- [self waitForExpectationsWithTimeout: 5 handler: ^(NSError * _Nullable error) {
211
- if (error) {
212
- XCTFail (@" Timeout error" );
213
- }
214
- }];
171
+ sleep (5 );
215
172
216
173
NSError * error;
217
174
NSData * logData = [NRLogger logFileData: &error];
@@ -264,17 +221,7 @@ - (void) testLocalLogLevels {
264
221
// Set the remote log level to Info.
265
222
[NRLogger setRemoteLogLevel: NRLogLevelInfo];
266
223
267
- XCTestExpectation *delayExpectation1 = [self expectationWithDescription: @" Waiting for Log Queue" ];
268
-
269
- dispatch_after (dispatch_time (DISPATCH_TIME_NOW, (int64_t )(2 * NSEC_PER_SEC)), dispatch_get_main_queue (), ^{
270
- [delayExpectation1 fulfill ];
271
- });
272
-
273
- [self waitForExpectationsWithTimeout: 5 handler: ^(NSError * _Nullable error) {
274
- if (error) {
275
- XCTFail (@" Timeout error" );
276
- }
277
- }];
224
+ sleep (1 );
278
225
279
226
// Seven messages should reach the remote log file for upload.
280
227
@@ -291,17 +238,7 @@ - (void) testLocalLogLevels {
291
238
@" additionalAttribute2" : @" attribute2"
292
239
}];
293
240
294
- XCTestExpectation *delayExpectation2 = [self expectationWithDescription: @" Waiting for Log Queue" ];
295
-
296
- dispatch_after (dispatch_time (DISPATCH_TIME_NOW, (int64_t )(2 * NSEC_PER_SEC)), dispatch_get_main_queue (), ^{
297
- [delayExpectation2 fulfill ];
298
- });
299
-
300
- [self waitForExpectationsWithTimeout: 5 handler: ^(NSError * _Nullable error) {
301
- if (error) {
302
- XCTFail (@" Timeout error" );
303
- }
304
- }];
241
+ sleep (5 );
305
242
306
243
NSError * error;
307
244
NSData * logData = [NRLogger logFileData: &error];
@@ -352,7 +289,7 @@ - (void) testAutoCollectedLogs {
352
289
[NRLogger setRemoteLogLevel: NRLogLevelDebug];
353
290
XCTAssertTrue ([NRAutoLogCollector redirectStandardOutputAndError ]);
354
291
355
- sleep (5 );
292
+ sleep (1 );
356
293
357
294
// Three messages should reach the remote log file for upload.
358
295
NSLog (@" NSLog Test \n\n " );
0 commit comments