From e6750cc9182ab77fd2380eb7b550604be1bc30e5 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Fri, 20 Dec 2024 13:07:57 -0500 Subject: [PATCH] increase tolerance --- tests/profiling_v2/test_accuracy.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/profiling_v2/test_accuracy.py b/tests/profiling_v2/test_accuracy.py index d0c643a051d..61fbe3322ff 100644 --- a/tests/profiling_v2/test_accuracy.py +++ b/tests/profiling_v2/test_accuracy.py @@ -13,7 +13,6 @@ def test_accuracy_libdd(): from ddtrace.profiling import profiler from tests.profiling.collector import pprof_utils - from tests.profiling.test_accuracy import CPU_TOLERANCE from tests.profiling.test_accuracy import assert_almost_equal from tests.profiling.test_accuracy import spend_16 @@ -47,10 +46,10 @@ def test_accuracy_libdd(): assert_almost_equal(wall_times["spend_16"], 16e9) assert_almost_equal(wall_times["spend_7"], 7e9) - assert_almost_equal(wall_times["spend_cpu_2"], 2e9) - assert_almost_equal(wall_times["spend_cpu_3"], 3e9) - assert_almost_equal(cpu_times["spend_cpu_2"], 2e9, CPU_TOLERANCE) - assert_almost_equal(cpu_times["spend_cpu_3"], 3e9, CPU_TOLERANCE) + assert_almost_equal(wall_times["spend_cpu_2"], 2e9, tolerance=0.07) + assert_almost_equal(wall_times["spend_cpu_3"], 3e9, tolerance=0.07) + assert_almost_equal(cpu_times["spend_cpu_2"], 2e9, tolerance=0.07) + assert_almost_equal(cpu_times["spend_cpu_3"], 3e9, tolerance=0.07) @pytest.mark.subprocess( @@ -96,7 +95,7 @@ def test_accuracy_stack_v2(): assert_almost_equal(wall_times["spend_16"], 16e9) assert_almost_equal(wall_times["spend_7"], 7e9) - assert_almost_equal(wall_times["spend_cpu_2"], 2e9) - assert_almost_equal(wall_times["spend_cpu_3"], 3e9) + assert_almost_equal(wall_times["spend_cpu_2"], 2e9, tolerance=0.07) + assert_almost_equal(wall_times["spend_cpu_3"], 3e9, tolerance=0.07) assert_almost_equal(cpu_times["spend_cpu_2"], 2e9, tolerance=0.07) assert_almost_equal(cpu_times["spend_cpu_3"], 3e9, tolerance=0.07)