From 724d97bb657b966099a22f0b26caadef6bce3152 Mon Sep 17 00:00:00 2001 From: Alex Wang Date: Thu, 9 Oct 2025 10:55:54 -0700 Subject: [PATCH 1/2] feat: Add validation for wait seconds --- src/aws_durable_execution_sdk_python/context.py | 5 ++++- tests/context_test.py | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/aws_durable_execution_sdk_python/context.py b/src/aws_durable_execution_sdk_python/context.py index e6f74c82..f2b954c2 100644 --- a/src/aws_durable_execution_sdk_python/context.py +++ b/src/aws_durable_execution_sdk_python/context.py @@ -431,9 +431,12 @@ def wait(self, seconds: int, name: str | None = None) -> None: """Wait for a specified amount of time. Args: - millis: Time to wait in milliseconds + seconds: Time to wait in seconds name: Optional name for the wait step """ + if seconds < 1: + msg = "seconds must be an integer greater than 0" + raise ValidationError(msg) wait_handler( seconds=seconds, state=self.state, diff --git a/tests/context_test.py b/tests/context_test.py index f49e84f1..9a58ede9 100644 --- a/tests/context_test.py +++ b/tests/context_test.py @@ -706,6 +706,20 @@ def test_wait_returns_none(mock_handler): assert result is None +@patch("aws_durable_execution_sdk_python.context.wait_handler") +def test_wait_with_time_less_than_one(mock_handler): + """Test wait with time less than one.""" + mock_state = Mock(spec=ExecutionState) + mock_state.durable_execution_arn = ( + "arn:aws:durable:us-east-1:123456789012:execution/test" + ) + + context = DurableContext(state=mock_state) + + with pytest.raises(ValidationError): + context.wait(0) + + # endregion wait From 0c8e50f27d81753f999f64a7e02eeb349da3ce01 Mon Sep 17 00:00:00 2001 From: Alex Wang Date: Thu, 9 Oct 2025 10:56:06 -0700 Subject: [PATCH 2/2] fix: remove python 3.11 build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1a368d0..e596bd66 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.11", "3.13"] + python-version: ["3.13"] steps: - uses: actions/checkout@v5