From 1a3fda7b25f2fedaa9b3b22dce5dc98607592f34 Mon Sep 17 00:00:00 2001 From: Jared O'Connell Date: Fri, 10 Oct 2025 15:23:19 -0400 Subject: [PATCH 1/3] Force time zone in tests Signed-off-by: Jared O'Connell --- tests/unit/utils/test_functions.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/unit/utils/test_functions.py b/tests/unit/utils/test_functions.py index 3b353759..3e542ca8 100644 --- a/tests/unit/utils/test_functions.py +++ b/tests/unit/utils/test_functions.py @@ -1,5 +1,6 @@ from __future__ import annotations +import time from datetime import datetime import pytest @@ -180,6 +181,17 @@ def test_single_value(self): assert result == 3.0 +@pytest.fixture(autouse=True) +def force_us_eastern_timezone(monkeypatch): + """ + Forces the timezone to US/Eastern for the duration of a test. + This ensures that timestamp formatting is consistent across all environments. + + ## WRITTEN BY AI ## + """ + monkeypatch.setenv("TZ", "America/New_York") + time.tzset() # Propagates the change to the underlying C library + class TestSafeFormatTimestamp: """Test suite for safe_format_timestamp function.""" From 6a1f57fb4317ef734d913fcc9fa231f0c82a8213 Mon Sep 17 00:00:00 2001 From: Jared O'Connell Date: Fri, 10 Oct 2025 15:51:42 -0400 Subject: [PATCH 2/3] Increase timeout to account for slow CI environment Signed-off-by: Jared O'Connell --- tests/unit/utils/test_messaging.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/unit/utils/test_messaging.py b/tests/unit/utils/test_messaging.py index d6b3283d..3e5eabc3 100644 --- a/tests/unit/utils/test_messaging.py +++ b/tests/unit/utils/test_messaging.py @@ -320,7 +320,7 @@ async def test_start_stop_lifecycle(self, valid_instances, stop_events_lambda): ), ], ) - @async_timeout(10.0) + @async_timeout(50.0) async def test_lifecycle_put_get(self, valid_instances, test_obj): instance, constructor_args, manager, context = valid_instances @@ -392,7 +392,7 @@ async def test_lifecycle_put_get(self, valid_instances, test_obj): ), ], ) - @async_timeout(10.0) + @async_timeout(50.0) async def test_lifecycle_put_get_iter(self, valid_instances, test_obj): instance, constructor_args, manager, context = valid_instances @@ -541,7 +541,7 @@ def test_create_worker_copy(self, valid_instances): lambda: [threading.Event(), multiprocessing.Event()], ], ) - @async_timeout(5.0) + @async_timeout(20.0) async def test_start_stop_lifecycle(self, valid_instances, stop_events_lambda): """Test InterProcessMessagingQueue start/stop lifecycle.""" instance, _, _, _ = valid_instances @@ -615,7 +615,7 @@ async def test_start_stop_lifecycle(self, valid_instances, stop_events_lambda): ), ], ) - @async_timeout(10.0) + @async_timeout(50.0) async def test_lifecycle_put_get(self, valid_instances, test_obj): instance, constructor_args, _, context = valid_instances @@ -687,7 +687,7 @@ async def test_lifecycle_put_get(self, valid_instances, test_obj): ), ], ) - @async_timeout(10.0) + @async_timeout(50.0) async def test_lifecycle_put_get_iter(self, valid_instances, test_obj): instance, constructor_args, _, context = valid_instances @@ -846,7 +846,7 @@ def test_create_worker_copy(self, valid_instances): @pytest.mark.smoke @pytest.mark.asyncio - @async_timeout(5.0) + @async_timeout(20.0) async def test_start_stop_lifecycle(self, valid_instances): """Test InterProcessMessagingPipe start/stop lifecycle.""" instance, _, _, _ = valid_instances @@ -915,7 +915,7 @@ async def test_start_stop_lifecycle(self, valid_instances): ), ], ) - @async_timeout(10.0) + @async_timeout(50.0) async def test_lifecycle_put_get(self, valid_instances, test_obj): instance, constructor_args, manager, context = valid_instances From db083f815a86e3a4ee1a0b2f1037a0cce9d7360d Mon Sep 17 00:00:00 2001 From: Jared O'Connell Date: Fri, 10 Oct 2025 16:20:23 -0400 Subject: [PATCH 3/3] Much more time for unit tests in attempt to fix tests in CI Signed-off-by: Jared O'Connell --- tests/integration/scheduler/test_worker_group.py | 2 +- tests/unit/utils/test_messaging.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/integration/scheduler/test_worker_group.py b/tests/integration/scheduler/test_worker_group.py index c3be2b99..c6a06791 100644 --- a/tests/integration/scheduler/test_worker_group.py +++ b/tests/integration/scheduler/test_worker_group.py @@ -104,7 +104,7 @@ async def resolve(self, request, request_info, request_history): class TestWorkerGroup: @pytest.mark.smoke @pytest.mark.asyncio - @async_timeout(5) + @async_timeout(240) @pytest.mark.parametrize( "strategy", [ diff --git a/tests/unit/utils/test_messaging.py b/tests/unit/utils/test_messaging.py index 3e5eabc3..a5f185b5 100644 --- a/tests/unit/utils/test_messaging.py +++ b/tests/unit/utils/test_messaging.py @@ -320,7 +320,7 @@ async def test_start_stop_lifecycle(self, valid_instances, stop_events_lambda): ), ], ) - @async_timeout(50.0) + @async_timeout(240.0) async def test_lifecycle_put_get(self, valid_instances, test_obj): instance, constructor_args, manager, context = valid_instances @@ -392,7 +392,7 @@ async def test_lifecycle_put_get(self, valid_instances, test_obj): ), ], ) - @async_timeout(50.0) + @async_timeout(240.0) async def test_lifecycle_put_get_iter(self, valid_instances, test_obj): instance, constructor_args, manager, context = valid_instances @@ -615,7 +615,7 @@ async def test_start_stop_lifecycle(self, valid_instances, stop_events_lambda): ), ], ) - @async_timeout(50.0) + @async_timeout(240.0) async def test_lifecycle_put_get(self, valid_instances, test_obj): instance, constructor_args, _, context = valid_instances @@ -687,7 +687,7 @@ async def test_lifecycle_put_get(self, valid_instances, test_obj): ), ], ) - @async_timeout(50.0) + @async_timeout(240.0) async def test_lifecycle_put_get_iter(self, valid_instances, test_obj): instance, constructor_args, _, context = valid_instances @@ -915,7 +915,7 @@ async def test_start_stop_lifecycle(self, valid_instances): ), ], ) - @async_timeout(50.0) + @async_timeout(240.0) async def test_lifecycle_put_get(self, valid_instances, test_obj): instance, constructor_args, manager, context = valid_instances