Skip to content

Commit 8ed0782

Browse files
committed
Updated some tests to use old default
1 parent 825546a commit 8ed0782

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/opentelemetry/test_sampler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ def keep_only_a(sampling_context):
178178
@pytest.mark.parametrize(
179179
"traces_sample_rate, expected_num_of_envelopes",
180180
[
181-
# special case for testing, do not pass any traces_sample_rate to init() (the default traces_sample_rate=0 will be used)
182-
(USE_DEFAULT_TRACES_SAMPLE_RATE, 1),
181+
# special case for testing, do not pass any traces_sample_rate to init() (the default traces_sample_rate=None will be used)
182+
(USE_DEFAULT_TRACES_SAMPLE_RATE, 0),
183183
# traces_sample_rate=None means do not create new traces, and also do not continue incoming traces. So, no envelopes at all.
184184
(None, 0),
185185
# traces_sample_rate=0 means do not create new traces (0% of the requests), but continue incoming traces. So envelopes will be created only if there is an incoming trace.
@@ -229,9 +229,9 @@ def test_sampling_parent_sampled(
229229
@pytest.mark.parametrize(
230230
"traces_sample_rate, upstream_sampled, expected_num_of_envelopes",
231231
[
232-
# special case for testing, do not pass any traces_sample_rate to init() (the default traces_sample_rate=0 will be used)
232+
# special case for testing, do not pass any traces_sample_rate to init() (the default traces_sample_rate=None will be used)
233233
(USE_DEFAULT_TRACES_SAMPLE_RATE, 0, 0),
234-
(USE_DEFAULT_TRACES_SAMPLE_RATE, 1, 1),
234+
(USE_DEFAULT_TRACES_SAMPLE_RATE, 1, 0),
235235
# traces_sample_rate=None means do not create new traces, and also do not continue incoming traces. So, no envelopes at all.
236236
(None, 0, 0),
237237
(None, 1, 0),

tests/test_dsc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ def my_traces_sampler(sampling_context):
287287
"local_traces_sampler_result": None,
288288
"local_traces_sample_rate": None,
289289
},
290-
1.0, # expected_sample_rate
291-
"true", # expected_sampled
290+
None, # expected_sample_rate
291+
"tracing-disabled-no-transactions-should-be-sent", # expected_sampled (traces_sample_rate=None disables all transaction creation)
292292
),
293293
( # 6 traces_sampler overrides incoming (traces_sample_rate not set)
294294
{

0 commit comments

Comments
 (0)