From 95bf7e355baa9acb4275d16718f9b678de8a4477 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Sun, 14 Jul 2024 17:10:02 +0200 Subject: [PATCH] Attempt to fix async sensor test flakiness (#40766) * Attempt to fix async sensor test flakiness The #40719 introduce flakiness that only shows with self-hosted runners - likely because the reference_time is modified in-place by ".add" and that introduces a subtle timing issue even if the tests are designed to avoid the timing issue. * Update tests/sensors/test_time_delta.py Co-authored-by: Hussein Awala --------- Co-authored-by: Hussein Awala --- tests/sensors/test_time_delta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sensors/test_time_delta.py b/tests/sensors/test_time_delta.py index 159cefab9ceaa..91a768b5b75c2 100644 --- a/tests/sensors/test_time_delta.py +++ b/tests/sensors/test_time_delta.py @@ -57,7 +57,7 @@ def setup_method(self): @pytest.mark.parametrize( "data_interval_end, delta, should_deffer", [ - (REFERENCE_TIME.add(hours=-1), timedelta(hours=1), False), + (REFERENCE_TIME.add(hours=-1, minutes=-1), timedelta(hours=1), False), (REFERENCE_TIME, timedelta(hours=1), True), ], )