Skip to content

Commit 89770ff

Browse files
cosmo0920edsiper
authored andcommitted
test: filter_stdout: Ensure TLS initialization on macOS.
This is because macOS requests surely initialization for pthread stuffs. In our code base, flb_init_env() should initialize thread local storage stuffs. Otherwise, FLB_TLS_GET returns invalid values. Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent 4c7d173 commit 89770ff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/runtime/filter_stdout.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ void flb_test_filter_stdout_case_insensitive(void)
3434
TEST_MSG("%s should be valid\n", filter_name);
3535
}
3636

37+
/* Initialize thread local storage (FLB_TLS) properly when without calling flb_start().
38+
* Then, FLB_TLS_GET working on macOS.
39+
* In general, macOS requests surely initialization for pthread stuffs.
40+
*/
41+
flb_init_env();
42+
43+
flb_stop(ctx);
3744
flb_destroy(ctx);
3845
}
3946

0 commit comments

Comments
 (0)