From fda905adcc5cb6a4bac773da6982c6f4b57bff95 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Mon, 25 Mar 2024 14:40:28 +0100 Subject: [PATCH] fix: exclude custom_logger from transport test-suite (#968) --- include/sentry.h | 5 +++++ tests/test_unit.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/include/sentry.h b/include/sentry.h index a6ceadc41..16b7e03fc 100644 --- a/include/sentry.h +++ b/include/sentry.h @@ -1068,6 +1068,11 @@ typedef void (*sentry_logger_function_t)( * Sets the sentry-native logger function. * * Used for logging debug events when the `debug` option is set to true. + * + * Note: Multiple threads may invoke your `func`. If you plan to mutate any data + * inside the `userdata` argument after initialization, you must ensure proper + * synchronization inside the logger function. + * */ SENTRY_API void sentry_options_set_logger( sentry_options_t *opts, sentry_logger_function_t func, void *userdata); diff --git a/tests/test_unit.py b/tests/test_unit.py index f75a719d7..3633efec9 100644 --- a/tests/test_unit.py +++ b/tests/test_unit.py @@ -14,6 +14,9 @@ def test_unit(cmake, unittest): @pytest.mark.skipif(not has_http, reason="tests need http transport") def test_unit_transport(cmake, unittest): + if unittest in ["custom_logger"]: + pytest.skip("excluded from transport test-suite") + cwd = cmake(["sentry_test_unit"], {"SENTRY_BACKEND": "none"}) env = dict(os.environ) run(cwd, "sentry_test_unit", ["--no-summary", unittest], check=True, env=env)