From 7c9952c3df9b2ebada5bac92e1f0550fe1bdcabc Mon Sep 17 00:00:00 2001 From: Ruben Fonseca Date: Thu, 20 Apr 2023 11:38:38 +0200 Subject: [PATCH 1/2] fix: ignore order when comparing thread results --- tests/e2e/idempotency/test_idempotency_dynamodb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/idempotency/test_idempotency_dynamodb.py b/tests/e2e/idempotency/test_idempotency_dynamodb.py index 06147227549..31382ff9050 100644 --- a/tests/e2e/idempotency/test_idempotency_dynamodb.py +++ b/tests/e2e/idempotency/test_idempotency_dynamodb.py @@ -130,4 +130,5 @@ def test_idempotent_function_thread_safety(function_thread_safety_handler_fn_arn assert function_thread["exception"] is None assert function_thread["output"] is not None - assert first_execution_response == second_execution_response + # we use set() here because we want to compare the elements regardless of their order in the array + assert set(first_execution_response) == set(second_execution_response) From 5920535dbfa4c2bf6a6309c3b7eaa7133ee12783 Mon Sep 17 00:00:00 2001 From: Ruben Fonseca Date: Thu, 20 Apr 2023 14:50:57 +0200 Subject: [PATCH 2/2] fix(e2e): fix e2e tests running on python 3.7 --- tests/e2e/streaming/handlers/s3_object_handler.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/e2e/streaming/handlers/s3_object_handler.py b/tests/e2e/streaming/handlers/s3_object_handler.py index 98bda22c2bb..3c47f4ab3b7 100644 --- a/tests/e2e/streaming/handlers/s3_object_handler.py +++ b/tests/e2e/streaming/handlers/s3_object_handler.py @@ -66,13 +66,15 @@ def lambda_handler(event, context): if transform_zip or transform_zip_lzma: response["manifest"] = obj.namelist() - response["body"] = obj.read(obj.namelist()[1]).rstrip() # extracts the second file on the zip + response["body"] = ( + obj.read(obj.namelist()[1]).rstrip().decode("utf-8") + ) # extracts the second file on the zip elif transform_csv or csv: response["body"] = obj.__next__() elif transform_gzip or gunzip: - response["body"] = obj.readline().rstrip() + response["body"] = obj.readline().rstrip().decode("utf-8") else: - response["body"] = obj.readline().rstrip() + response["body"] = obj.readline().rstrip().decode("utf-8") except botocore.exceptions.ClientError as e: if e.response["Error"]["Code"] == "404": response["error"] = "Not found"