File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,7 @@ void flb_test_events_v1_with_lastTimestamp()
328
328
int ret ;
329
329
int num ;
330
330
const char * filename = "eventlist_v1_with_lastTimestamp" ;
331
+ int trys ;
331
332
332
333
clear_output_num ();
333
334
@@ -347,8 +348,10 @@ void flb_test_events_v1_with_lastTimestamp()
347
348
ret = flb_start (ctx -> flb );
348
349
TEST_CHECK (ret == 0 );
349
350
350
- // waiting to flush
351
- flb_time_msleep (1500 );
351
+ // waiting to flush
352
+ for (trys = 0 ; trys < 5 && get_output_num () <= 0 ; trys ++ ) {
353
+ flb_time_msleep (1000 );
354
+ }
352
355
353
356
num = get_output_num ();
354
357
if (!TEST_CHECK (num > 0 )) {
@@ -365,6 +368,7 @@ void flb_test_events_v1_with_creationTimestamp()
365
368
int ret ;
366
369
int num ;
367
370
const char * filename = "eventlist_v1_with_creationTimestamp" ;
371
+ int trys ;
368
372
369
373
clear_output_num ();
370
374
@@ -384,8 +388,10 @@ void flb_test_events_v1_with_creationTimestamp()
384
388
ret = flb_start (ctx -> flb );
385
389
TEST_CHECK (ret == 0 );
386
390
387
- // waiting to flush
388
- flb_time_msleep (1500 );
391
+ // waiting to flush
392
+ for (trys = 0 ; trys < 5 && get_output_num () <= 0 ; trys ++ ) {
393
+ flb_time_msleep (1000 );
394
+ }
389
395
390
396
num = get_output_num ();
391
397
if (!TEST_CHECK (num > 0 )) {
@@ -399,6 +405,7 @@ void flb_test_events_with_chunkedrecv()
399
405
{
400
406
struct flb_lib_out_cb cb_data ;
401
407
struct test_ctx * ctx ;
408
+ int trys ;
402
409
403
410
int ret ;
404
411
int num ;
@@ -423,8 +430,10 @@ void flb_test_events_with_chunkedrecv()
423
430
ret = flb_start (ctx -> flb );
424
431
TEST_CHECK (ret == 0 );
425
432
426
- // waiting to flush
427
- flb_time_msleep (5000 );
433
+ // waiting to flush
434
+ for (trys = 0 ; trys < 5 && get_output_num () <= 1 ; trys ++ ) {
435
+ flb_time_msleep (1000 );
436
+ }
428
437
429
438
num = get_output_num ();
430
439
if (!TEST_CHECK (num >= 2 )) {
You can’t perform that action at this time.
0 commit comments