From ef2f7fd36a37e68ff1368abc3cd6d1550085c711 Mon Sep 17 00:00:00 2001 From: Phillip Whelan Date: Mon, 6 Nov 2023 18:58:32 -0300 Subject: [PATCH] input: fix custom calyptia test (input/output initialization). Set coroutine parameters to NULL for input and output via their initializers. Signed-off-by: Phillip Whelan --- src/flb_input.c | 1 + src/flb_output.c | 1 + tests/runtime/custom_calyptia_test.c | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/flb_input.c b/src/flb_input.c index 204e164aeec..6c77cac6c6c 100644 --- a/src/flb_input.c +++ b/src/flb_input.c @@ -144,6 +144,7 @@ int flb_input_log_check(struct flb_input_instance *ins, int l) void flb_input_init() { FLB_TLS_INIT(in_collect_params); + FLB_TLS_SET(in_collect_params, NULL); } void flb_input_exit() diff --git a/src/flb_output.c b/src/flb_output.c index b1548f60dfa..cbc39f74512 100644 --- a/src/flb_output.c +++ b/src/flb_output.c @@ -45,6 +45,7 @@ FLB_TLS_DEFINE(struct flb_out_flush_params, out_flush_params); void flb_output_prepare() { FLB_TLS_INIT(out_flush_params); + FLB_TLS_SET(out_flush_params, NULL); } /* Validate the the output address protocol */ diff --git a/tests/runtime/custom_calyptia_test.c b/tests/runtime/custom_calyptia_test.c index 5ad30e7a0bf..101b1386c76 100644 --- a/tests/runtime/custom_calyptia_test.c +++ b/tests/runtime/custom_calyptia_test.c @@ -19,6 +19,9 @@ void flb_custom_calyptia_pipeline_config_get_test() ctx = flb_create(); flb_service_set(ctx, "flush", "1", "grace", "1", NULL); + flb_input_init(); + flb_output_prepare(); + in_ffd_dummy = flb_input(ctx, (char *) "dummy", NULL); TEST_CHECK(in_ffd_dummy >= 0); @@ -46,8 +49,6 @@ void flb_custom_calyptia_pipeline_config_get_test() cfg = custom_calyptia_pipeline_config_get(ctx->config); TEST_CHECK(strcmp(cfg, cfg_str) == 0); - // fix a thread local storage bug on macos - flb_output_prepare(); flb_sds_destroy(cfg); flb_destroy(ctx); }