diff --git a/tests/parametric/test_span_sampling.py b/tests/parametric/test_span_sampling.py index 309a33b7ed4..34e65cb08eb 100644 --- a/tests/parametric/test_span_sampling.py +++ b/tests/parametric/test_span_sampling.py @@ -838,6 +838,7 @@ def test_single_rule_with_head_and_rule_trace_sampling_keep_019( "DD_TRACE_PROPAGATION_STYLE": "datadog", "DD_SPAN_SAMPLING_RULES": json.dumps([{"name": "web.request", "sample_rate": 0.0}]), "DD_TRACE_SAMPLING_RULES": json.dumps([{"name": "web.request", "sample_rate": 0.0}]), + "DD_TRACE_STATS_COMPUTATION_ENABLED": "false", # Disable stats computation to send P0s } ], ) @@ -876,9 +877,7 @@ def test_single_rule_with_head_and_rule_trace_sampling_drop_020( test_library.dd_flush() - tracer_sends_p0 = context.library.name != "java" or context.library.version <= "1.54" - - traces = test_agent.wait_for_num_traces(2 if tracer_sends_p0 else 1) + traces = test_agent.wait_for_num_traces(2) case1 = find_span_in_traces(traces, s1.trace_id, s1.span_id) # Assert the RUM origin is set @@ -893,16 +892,15 @@ def test_single_rule_with_head_and_rule_trace_sampling_drop_020( assert SINGLE_SPAN_SAMPLING_RATE not in case1["metrics"] assert SINGLE_SPAN_SAMPLING_MAX_PER_SEC not in case1["metrics"] - if tracer_sends_p0: - case2 = find_span_in_traces(traces, s2.trace_id, s2.span_id) - # Assert the RUM origin is set - assert case2["meta"]["_dd.origin"] == "rum" - # Assert the propagated sampling priority is unaffected - assert case2["metrics"].get(SAMPLING_PRIORITY_KEY) == 0 - # Assert that there is no trace sampling happening - assert "_dd.p.dm" not in case2["meta"] - assert "_dd.rule_psr" not in case2["meta"] - # Assert that there is no single span sampling happening - assert SINGLE_SPAN_SAMPLING_MECHANISM not in case1["metrics"] - assert SINGLE_SPAN_SAMPLING_RATE not in case1["metrics"] - assert SINGLE_SPAN_SAMPLING_MAX_PER_SEC not in case1["metrics"] + case2 = find_span_in_traces(traces, s2.trace_id, s2.span_id) + # Assert the RUM origin is set + assert case2["meta"]["_dd.origin"] == "rum" + # Assert the propagated sampling priority is unaffected + assert case2["metrics"].get(SAMPLING_PRIORITY_KEY) == 0 + # Assert that there is no trace sampling happening + assert "_dd.p.dm" not in case2["meta"] + assert "_dd.rule_psr" not in case2["meta"] + # Assert that there is no single span sampling happening + assert SINGLE_SPAN_SAMPLING_MECHANISM not in case1["metrics"] + assert SINGLE_SPAN_SAMPLING_RATE not in case1["metrics"] + assert SINGLE_SPAN_SAMPLING_MAX_PER_SEC not in case1["metrics"]