Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/runtime/core_chunk_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <unistd.h>
#include "flb_tests_runtime.h"

#define FLB_TEST_MAX_WAIT 60

struct callback_record {
void *data;
Expand Down Expand Up @@ -101,9 +102,12 @@ void do_test_records_trace(void (*records_cb)(struct callback_records *))
/* Start test */
TEST_CHECK(flb_start(ctx) == 0);

/* 4 sec passed. It must have flushed */
sleep(5);

/* 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++ ) {
sleep(1);
}
flb_info("[test] collected records, waited %d seconds", i);

records_cb(records);

flb_stop(ctx);
Expand Down
Loading