Skip to content

Commit

Permalink
input: fix custom calyptia test (input/output initialization).
Browse files Browse the repository at this point in the history
Set coroutine parameters to NULL for input and output via their initializers.

Signed-off-by: Phillip Whelan <[email protected]>
  • Loading branch information
pwhelan committed Nov 6, 2023
1 parent 0abf858 commit ef2f7fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/flb_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions src/flb_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
5 changes: 3 additions & 2 deletions tests/runtime/custom_calyptia_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit ef2f7fd

Please sign in to comment.