Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/tracer/test_single_span_sampling_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,15 @@ def test_rule_init_via_env_no_name_or_service_logs_warning_and_continues(


def test_rule_init_via_env_service_pattern_contains_unsupported_char():
with override_global_config(dict(_sampling_rules='[{"service":"h[!a]i"}]')):
# Unsupported glob chars are only rejected when config._raise is True (testing mode). _raise is
# a process-global bridged to the native config, and other tests in the same worker can flip it,
# so force it here to keep this test order-independent instead of relying on the ambient value.
with override_global_config(dict(_sampling_rules='[{"service":"h[!a]i"}]', _raise=True)):
assert get_span_sampling_rules() == []


def test_rule_init_via_env_name_pattern_contains_unsupported_char():
with override_global_config(dict(_sampling_rules='[{"name":"h[!a]i"}]')):
with override_global_config(dict(_sampling_rules='[{"name":"h[!a]i"}]', _raise=True)):
assert get_span_sampling_rules() == []


Expand Down
Loading