-
Notifications
You must be signed in to change notification settings - Fork 23
test: add replay identity conformance case #701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7a65d6c
335b745
d8f9c98
7e852e4
0325f6a
561f380
69f2339
82c866e
a2233e9
ed0d242
d0f2017
7216ea0
be1d349
95a7a33
b326ac8
529310c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """General cross-cutting conformance handlers.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| """11-1: Replay rejects an operation-type mismatch.""" | ||
|
|
||
| from typing import Any | ||
|
|
||
| from aws_durable_execution_sdk_python.config import Duration | ||
| from aws_durable_execution_sdk_python.context import ( | ||
| DurableContext, | ||
| StepContext, | ||
| durable_step, | ||
| ) | ||
| from aws_durable_execution_sdk_python.execution import durable_execution | ||
|
|
||
|
|
||
| @durable_step | ||
| def unexpected_step(step_context: StepContext) -> str: | ||
| step_context.logger.info("DETERMINISM_STEP_BODY_EXECUTED") | ||
|
zhongkechen marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codex AI review · Finding [P2] Make the step-body canary replay-visible The step inherits the replaying context's logger, so this INFO call is suppressed. If a regression executes |
||
| return "unexpected" | ||
|
|
||
|
|
||
| @durable_execution | ||
| def handler(_event: Any, context: DurableContext) -> str | None: | ||
| replay_logger = context.logger.with_is_replaying(lambda: False) | ||
|
|
||
| if context.is_replaying(): | ||
| replay_logger.info("DETERMINISM_REPLAY_CANARY") | ||
| return context.step(unexpected_step(), name="identity-slot") | ||
|
|
||
| context.wait(Duration.from_seconds(1), name="identity-slot") | ||
| return None | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| AWSTemplateFormatVersion: '2010-09-09' | ||
| Transform: AWS::Serverless-2016-10-31 | ||
| Globals: | ||
| Function: | ||
| Runtime: python3.13 | ||
| Timeout: 60 | ||
| MemorySize: 128 | ||
|
zhongkechen marked this conversation as resolved.
|
||
| LoggingConfig: | ||
| LogFormat: JSON | ||
| ApplicationLogLevel: INFO | ||
| SystemLogLevel: INFO | ||
| Resources: | ||
| DurableFunctionRole: | ||
| Type: AWS::IAM::Role | ||
| Properties: | ||
| AssumeRolePolicyDocument: | ||
| Version: '2012-10-17' | ||
| Statement: | ||
| - Effect: Allow | ||
| Principal: | ||
| Service: lambda.amazonaws.com | ||
| Action: sts:AssumeRole | ||
| ManagedPolicyArns: | ||
| - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole | ||
| Policies: | ||
| - PolicyName: DurableExecutionPolicy | ||
| PolicyDocument: | ||
| Version: '2012-10-17' | ||
| Statement: | ||
| - Effect: Allow | ||
| Action: | ||
| - lambda:CheckpointDurableExecution | ||
| - lambda:GetDurableExecutionState | ||
| Resource: '*' | ||
| ReplayOperationIdentity: | ||
| Type: AWS::Serverless::Function | ||
| TestingMetadata: | ||
| TestDescription: ["11-1"] | ||
| Properties: | ||
| CodeUri: lambda-build/ | ||
| Handler: general.replay_operation_identity.handler | ||
| Description: Replay rejects an operation-type mismatch | ||
| Role: | ||
| Fn::GetAtt: | ||
| - DurableFunctionRole | ||
| - Arn | ||
| DurableConfig: | ||
| RetentionPeriodInDays: 7 | ||
| ExecutionTimeout: 300 | ||
Uh oh!
There was an error while loading. Please reload this page.