diff --git a/packages/aws-durable-execution-sdk-python-examples/test/map/test_map_with_min_successful.py b/packages/aws-durable-execution-sdk-python-examples/test/map/test_map_with_min_successful.py index c3a21772..33412455 100644 --- a/packages/aws-durable-execution-sdk-python-examples/test/map/test_map_with_min_successful.py +++ b/packages/aws-durable-execution-sdk-python-examples/test/map/test_map_with_min_successful.py @@ -64,7 +64,8 @@ def test_map_with_min_successful(durable_runner): op for op in map_op.child_operations if op.status is OperationStatus.STARTED ] - # Should have 6-7 successes, 0 failures, and remaining in STARTED state - assert len(succeeded) == result_data["success_count"] + # The operation tree may observe one already-running child completing after + # the BatchResult snapshot used by the handler response. + assert result_data["success_count"] <= len(succeeded) <= 7 assert len(failed) == 0 - assert len(started) == 10 - result_data["success_count"] + assert len(started) == 10 - len(succeeded) diff --git a/packages/aws-durable-execution-sdk-python/tests/concurrency_test.py b/packages/aws-durable-execution-sdk-python/tests/concurrency_test.py index d3de5a1e..8796343c 100644 --- a/packages/aws-durable-execution-sdk-python/tests/concurrency_test.py +++ b/packages/aws-durable-execution-sdk-python/tests/concurrency_test.py @@ -3292,6 +3292,7 @@ def slow_func(): execution_state = Mock() execution_state.create_checkpoint = Mock() + execution_state.wrap_user_function = lambda func, *args, **kwargs: func executor_context = Mock() executor_context._create_step_id_for_logical_step = lambda idx: f"step_{idx}" # noqa: SLF001 executor_context._parent_id = "parent" # noqa: SLF001