From 529178d9ae1eb721c2402cd7a09c96e7d76bc04e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Em=C3=ADdio=20Neto?= <9735060+emdneto@users.noreply.github.com> Date: Mon, 1 Jul 2024 13:35:10 -0300 Subject: [PATCH] Fix wrong unit in Flask new semconv test (#2645) --- .../tests/test_programmatic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py index f50d3245a0..3f47eebcca 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py +++ b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py @@ -497,7 +497,7 @@ def test_flask_metrics_new_semconv(self): self.client.get("/hello/123") self.client.get("/hello/321") self.client.get("/hello/756") - duration = max(round((default_timer() - start) * 1000), 0) + duration_s = max(default_timer() - start, 0) metrics_list = self.memory_metrics_reader.get_metrics_data() number_data_point_seen = False histogram_data_point_seen = False @@ -514,7 +514,7 @@ def test_flask_metrics_new_semconv(self): if isinstance(point, HistogramDataPoint): self.assertEqual(point.count, 3) self.assertAlmostEqual( - duration, point.sum, delta=10 + duration_s, point.sum, places=2 ) histogram_data_point_seen = True if isinstance(point, NumberDataPoint):