Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/aws_durable_execution_sdk_python/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 14 additions & 0 deletions tests/context_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down