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 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