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
1 change: 0 additions & 1 deletion examples/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ def get_aws_config():
def get_lambda_client():
"""Get configured Lambda client."""
config = get_aws_config()
LambdaClient.load_preview_botocore_models()
return boto3.client(
"lambda",
endpoint_url=config["lambda_endpoint"],
Expand Down
16 changes: 3 additions & 13 deletions examples/test/map/test_map_completion.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Tests for map_completion."""

import json

import pytest

from src.map import map_completion
Expand All @@ -23,19 +21,11 @@ def test_reproduce_completion_config_behavior_with_detailed_logging(durable_runn

result_data = deserialize_operation_payload(result.result)

# 4 or 5 items are processed despite min_successful=2, which is expected due to the concurrent executor nature.
# When the completion requirements are met and 2 items succeed, a completion event is set and the main thread
# continues to cancel remaining futures. However, background threads cannot be stopped immediately since they're
# not in the critical section. There's a gap between setting the completion_event and all futures actually stopping,
# during which concurrent threads continue processing and increment counters. With max_concurrency=3 and 5 items,
# 4 or 5 items may complete before the cancellation takes effect. This means >= 4 items are processed as expected
# due to concurrency, with 4 or 5 items being typical in practice.
#
# 5 items are processed 2 of them succeeded. We exit early because min_successful is 2.
# Additionally, failure_count shows 0 because failed items have retry strategies configured and are still retrying
# when execution completes. Failures aren't finalized until retries complete, so they don't appear in the failure_count.

assert result_data["totalItems"] >= 4
assert result_data["successfulCount"] >= 2
assert result_data["totalItems"] == 5
assert result_data["successfulCount"] == 2
assert result_data["failedCount"] == 0
assert result_data["hasFailures"] is False
assert result_data["batchStatus"] == "BatchItemStatus.SUCCEEDED"
Expand Down
Loading