Skip to content

Commit 32a5197

Browse files
committed
tests: increase timeout in core_chunk_trace runtime test
Signed-off-by: Alexandre Létourneau <letourneau.alexandre@gmail.com>
1 parent f879a93 commit 32a5197

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/runtime/core_chunk_trace.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <unistd.h>
2727
#include "flb_tests_runtime.h"
2828

29+
#define FLB_TEST_MAX_WAIT 60
2930

3031
struct callback_record {
3132
void *data;
@@ -101,9 +102,12 @@ void do_test_records_trace(void (*records_cb)(struct callback_records *))
101102
/* Start test */
102103
TEST_CHECK(flb_start(ctx) == 0);
103104

104-
/* 4 sec passed. It must have flushed */
105-
sleep(5);
106-
105+
/* Wait at most FLB_TEST_MAX_WAIT seconds for the dummy input, and trace callback */
106+
for(i = 0; records->num_records == 0 && i < FLB_TEST_MAX_WAIT; i++ ) {
107+
sleep(1);
108+
}
109+
flb_info("[test] collected records, waited %d seconds", i);
110+
107111
records_cb(records);
108112

109113
flb_stop(ctx);

0 commit comments

Comments
 (0)