Skip to content

Commit 8e96bb1

Browse files
Fix Idempotency test
1 parent 1cf39f2 commit 8e96bb1

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

tests/e2e/idempotency/infrastructure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from aws_cdk import CfnOutput, RemovalPolicy
1+
from aws_cdk import CfnOutput, Duration, RemovalPolicy
22
from aws_cdk import aws_dynamodb as dynamodb
33
from aws_cdk.aws_dynamodb import Table
44

@@ -7,7 +7,7 @@
77

88
class IdempotencyDynamoDBStack(BaseInfrastructure):
99
def create_resources(self):
10-
table = self._create_dynamodb_table()
10+
table = self._create_dynamodb_table(function_props={"timeout": Duration.seconds(10)})
1111

1212
env_vars = {"IdempotencyTable": table.table_name}
1313
functions = self.create_lambda_functions(function_props={"environment": env_vars})

tests/e2e/idempotency/test_idempotency_dynamodb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_ttl_caching_expiration_idempotency(ttl_cache_expiration_handler_fn_arn:
8383
def test_ttl_caching_timeout_idempotency(ttl_cache_timeout_handler_fn_arn: str):
8484
# GIVEN
8585
payload_timeout_execution = json.dumps(
86-
{"sleep": 5, "message": "Powertools for AWS Lambda (Python) - TTL 1s"},
86+
{"sleep": 12, "message": "Powertools for AWS Lambda (Python) - TTL 1s"},
8787
sort_keys=True,
8888
)
8989
payload_working_execution = json.dumps(

tests/e2e/idempotency_redis/infrastructure.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import time
22
from typing import Tuple
33

4+
from aws_cdk import Duration
45
from aws_cdk import aws_ec2 as ec2
56
from aws_cdk.aws_ec2 import (
67
SecurityGroup,
@@ -30,6 +31,7 @@ def create_resources(self) -> None:
3031
"environment": env_vars,
3132
"vpc": vpc_stack,
3233
"security_groups": [security_groups[1]],
34+
"timeout": Duration.seconds(10),
3335
},
3436
)
3537

tests/e2e/idempotency_redis/test_idempotency_redis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_ttl_caching_expiration_idempotency(ttl_cache_expiration_handler_fn_arn:
6969
def test_ttl_caching_timeout_idempotency(ttl_cache_timeout_handler_fn_arn: str):
7070
# GIVEN
7171
payload_timeout_execution = json.dumps(
72-
{"sleep": 5, "message": "Powertools for AWS Lambda (Python) - TTL 1s"},
72+
{"sleep": 12, "message": "Powertools for AWS Lambda (Python) - TTL 1s"},
7373
sort_keys=True,
7474
)
7575
payload_working_execution = json.dumps(

0 commit comments

Comments
 (0)