Skip to content

Commit

Permalink
Fix Idempotency test
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrodamascena committed Sep 12, 2024
1 parent 1cf39f2 commit 8e96bb1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/e2e/idempotency/infrastructure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from aws_cdk import CfnOutput, RemovalPolicy
from aws_cdk import CfnOutput, Duration, RemovalPolicy
from aws_cdk import aws_dynamodb as dynamodb
from aws_cdk.aws_dynamodb import Table

Expand All @@ -7,7 +7,7 @@

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

env_vars = {"IdempotencyTable": table.table_name}
functions = self.create_lambda_functions(function_props={"environment": env_vars})
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/idempotency/test_idempotency_dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_ttl_caching_expiration_idempotency(ttl_cache_expiration_handler_fn_arn:
def test_ttl_caching_timeout_idempotency(ttl_cache_timeout_handler_fn_arn: str):
# GIVEN
payload_timeout_execution = json.dumps(
{"sleep": 5, "message": "Powertools for AWS Lambda (Python) - TTL 1s"},
{"sleep": 12, "message": "Powertools for AWS Lambda (Python) - TTL 1s"},
sort_keys=True,
)
payload_working_execution = json.dumps(
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/idempotency_redis/infrastructure.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import time
from typing import Tuple

from aws_cdk import Duration
from aws_cdk import aws_ec2 as ec2
from aws_cdk.aws_ec2 import (
SecurityGroup,
Expand Down Expand Up @@ -30,6 +31,7 @@ def create_resources(self) -> None:
"environment": env_vars,
"vpc": vpc_stack,
"security_groups": [security_groups[1]],
"timeout": Duration.seconds(10),
},
)

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/idempotency_redis/test_idempotency_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_ttl_caching_expiration_idempotency(ttl_cache_expiration_handler_fn_arn:
def test_ttl_caching_timeout_idempotency(ttl_cache_timeout_handler_fn_arn: str):
# GIVEN
payload_timeout_execution = json.dumps(
{"sleep": 5, "message": "Powertools for AWS Lambda (Python) - TTL 1s"},
{"sleep": 12, "message": "Powertools for AWS Lambda (Python) - TTL 1s"},
sort_keys=True,
)
payload_working_execution = json.dumps(
Expand Down

0 comments on commit 8e96bb1

Please sign in to comment.