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/conformance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
run: python3 scripts/build_examples.py

- name: Install conformance runner
run: pip install aws-durable-execution-conformance-tests==0.1.0
run: pip install "git+https://github.com/aws/aws-durable-execution-conformance-tests.git@main#subdirectory=packages/aws-durable-execution-conformance-tests"

- name: Inject Lambda execution role into template
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ def generate_data(_step_context: StepContext) -> str:

@durable_with_child_context
def large_data_processor(ctx: DurableContext, *, input_1: str) -> str:
print(input_1, flush=True)
# Log through the child context logger so the record carries the execution
# ARN. The context logger de-duplicates while the context is replaying, so
# rebind the replay source to enable replay logging: the child body re-runs
# in ReplayChildren mode to rebuild the large result, and that re-execution
# emits no history events, making the log the only evidence it happened.
ctx.logger.with_is_replaying(lambda: False).info(input_1)
step_result: str = ctx.step(generate_data())
# Build a large result (>256KB) from the small step result
large_result = step_result * 6 # ~300KB
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""3-17: Child context with print only (verify no re-execution on replay)."""
"""3-17: Child context with durable logger only (verify no re-execution on replay)."""

from typing import Any

Expand All @@ -11,8 +11,12 @@


@durable_with_child_context
def print_child(_ctx: DurableContext, *, input_1: str) -> str:
print(input_1, flush=True)
def print_child(ctx: DurableContext, *, input_1: str) -> str:
# Log through the child context logger so the record carries the execution
# ARN. Rebinding the replay source enables replay logging, which is what
# makes this assertion meaningful: under the default de-duplication an
# incorrect second child execution would be suppressed and still count 1.
ctx.logger.with_is_replaying(lambda: False).info(input_1)
return input_1


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@


@durable_step
def at_most_once_flaky_step(_step_context: StepContext, *, input_1: str) -> str:
print(input_1, flush=True)
def at_most_once_flaky_step(step_context: StepContext, *, input_1: str) -> str:
# Log through the step context logger so the record carries the execution
# ARN and can be correlated to this durable execution in CloudWatch.
step_context.logger.info(input_1)
time.sleep(1) # Allow time for logs to flush to CloudWatch
os._exit(1) # Simulate Lambda crash
return "unreachable"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@

@durable_step
def at_most_once_step(step_context: StepContext, *, input_1: str) -> str:
# Print input to stdout each time step executes
print(input_1, flush=True)
# Log the input through the step context logger each time the step executes
# so each record carries the execution ARN for CloudWatch correlation.
step_context.logger.info(input_1)
time.sleep(1) # Allow time for logs to flush to CloudWatch

# The attempt number is the SDK's built-in durable counter from the step
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Globals:
Runtime: python3.13
Timeout: 60
MemorySize: 128
# The conformance runner correlates CloudWatch records to a durable
# execution with a JSON filter on the executionArn field the SDK context
# logger attaches. That field only survives under the JSON log format.
LoggingConfig:
LogFormat: JSON
ApplicationLogLevel: INFO
SystemLogLevel: INFO
Resources:
DurableFunctionRole:
Type: AWS::IAM::Role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Globals:
Runtime: python3.13
Timeout: 60
MemorySize: 128
# The conformance runner correlates CloudWatch records to a durable
# execution with a JSON filter on the executionArn field the SDK context
# logger attaches. That field only survives under the JSON log format.
LoggingConfig:
LogFormat: JSON
ApplicationLogLevel: INFO
SystemLogLevel: INFO
Resources:
DurableFunctionRole:
Type: AWS::IAM::Role
Expand Down
Loading