|
35 | 35 | from aws_durable_execution_sdk_python_testing.checkpoint.processor import ( |
36 | 36 | CheckpointProcessor, |
37 | 37 | ) |
| 38 | +from aws_durable_execution_sdk_python_testing.checkpoint.processors.wait import ( |
| 39 | + WaitProcessor, |
| 40 | +) |
38 | 41 | from aws_durable_execution_sdk_python_testing.client import InMemoryServiceClient |
39 | 42 | from aws_durable_execution_sdk_python_testing.exceptions import ( |
40 | 43 | DurableFunctionsLocalRunnerError, |
@@ -606,7 +609,28 @@ def run( |
606 | 609 | function_name: str = "test-function", |
607 | 610 | execution_name: str = "execution-name", |
608 | 611 | account_id: str = "123456789012", |
| 612 | + skip_time: bool = False, |
609 | 613 | ) -> DurableFunctionTestResult: |
| 614 | + """Run the durable function and wait for completion. |
| 615 | +
|
| 616 | + Args: |
| 617 | + input: Input payload for the function |
| 618 | + timeout: Maximum execution time in seconds |
| 619 | + function_name: Name of the function |
| 620 | + execution_name: Name of the execution |
| 621 | + account_id: AWS account ID |
| 622 | + skip_time: If True, wait operations complete immediately. If False (default), |
| 623 | + wait operations use real time delays. |
| 624 | +
|
| 625 | + Returns: |
| 626 | + Test result containing execution status and operations |
| 627 | + """ |
| 628 | + # Update time_scale in checkpoint processor for this run |
| 629 | + time_scale = 0.0 if skip_time else 1.0 |
| 630 | + self._checkpoint_processor._transformer.processors[OperationType.WAIT] = ( |
| 631 | + WaitProcessor(time_scale=time_scale) |
| 632 | + ) |
| 633 | + |
610 | 634 | execution_arn = self.run_async( |
611 | 635 | input=input, |
612 | 636 | timeout=timeout, |
|
0 commit comments