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_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.""" diff --git a/tests/unit/utils/test_messaging.py b/tests/unit/utils/test_messaging.py index d6b3283d..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(10.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(10.0) + @async_timeout(240.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(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(10.0) + @async_timeout(240.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(240.0) async def test_lifecycle_put_get(self, valid_instances, test_obj): instance, constructor_args, manager, context = valid_instances