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()
328328 int ret ;
329329 int num ;
330330 const char * filename = "eventlist_v1_with_lastTimestamp" ;
331+ int trys ;
331332
332333 clear_output_num ();
333334
@@ -347,8 +348,10 @@ void flb_test_events_v1_with_lastTimestamp()
347348 ret = flb_start (ctx -> flb );
348349 TEST_CHECK (ret == 0 );
349350
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+ }
352355
353356 num = get_output_num ();
354357 if (!TEST_CHECK (num > 0 )) {
@@ -365,6 +368,7 @@ void flb_test_events_v1_with_creationTimestamp()
365368 int ret ;
366369 int num ;
367370 const char * filename = "eventlist_v1_with_creationTimestamp" ;
371+ int trys ;
368372
369373 clear_output_num ();
370374
@@ -384,8 +388,10 @@ void flb_test_events_v1_with_creationTimestamp()
384388 ret = flb_start (ctx -> flb );
385389 TEST_CHECK (ret == 0 );
386390
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+ }
389395
390396 num = get_output_num ();
391397 if (!TEST_CHECK (num > 0 )) {
@@ -399,6 +405,7 @@ void flb_test_events_with_chunkedrecv()
399405{
400406 struct flb_lib_out_cb cb_data ;
401407 struct test_ctx * ctx ;
408+ int trys ;
402409
403410 int ret ;
404411 int num ;
@@ -423,8 +430,10 @@ void flb_test_events_with_chunkedrecv()
423430 ret = flb_start (ctx -> flb );
424431 TEST_CHECK (ret == 0 );
425432
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+ }
428437
429438 num = get_output_num ();
430439 if (!TEST_CHECK (num >= 2 )) {
You can’t perform that action at this time.
0 commit comments