Skip to content

Commit

Permalink
in_event_test: Add +1 for acceptable time elapse
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored and edsiper committed Aug 22, 2023
1 parent 6c73a8a commit 4498a6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/in_event_test/event_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ static int cb_collector_time(struct flb_input_instance *ins,

now = time(NULL);
diff = now - config->init_time;
if (diff > CALLBACK_TIME) {
/* For macOS, we sometimes get the +1 longer time elapse.
* To handle this, we simply add +1 as a delta for checking interval. */
if (diff > (CALLBACK_TIME + 1)) {
flb_plg_error(ins, "cb_collector_time difference failed: %i seconds", diff);
set_unit_test_status(ctx, 0, STATUS_ERROR);
flb_engine_exit(config);
Expand Down

0 comments on commit 4498a6b

Please sign in to comment.