We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f879a93 commit 32a5197Copy full SHA for 32a5197
tests/runtime/core_chunk_trace.c
@@ -26,6 +26,7 @@
26
#include <unistd.h>
27
#include "flb_tests_runtime.h"
28
29
+#define FLB_TEST_MAX_WAIT 60
30
31
struct callback_record {
32
void *data;
@@ -101,9 +102,12 @@ void do_test_records_trace(void (*records_cb)(struct callback_records *))
101
102
/* Start test */
103
TEST_CHECK(flb_start(ctx) == 0);
104
- /* 4 sec passed. It must have flushed */
105
- sleep(5);
106
-
+ /* Wait at most FLB_TEST_MAX_WAIT seconds for the dummy input, and trace callback */
+ 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
+
111
records_cb(records);
112
113
flb_stop(ctx);
0 commit comments