Skip to content

Commit 6d466f4

Browse files
authored
fix(e2e): fix test brittleness (#2152)
1 parent 146d006 commit 6d466f4

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tests/e2e/idempotency/test_idempotency_dynamodb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,5 @@ def test_idempotent_function_thread_safety(function_thread_safety_handler_fn_arn
130130
assert function_thread["exception"] is None
131131
assert function_thread["output"] is not None
132132

133-
assert first_execution_response == second_execution_response
133+
# we use set() here because we want to compare the elements regardless of their order in the array
134+
assert set(first_execution_response) == set(second_execution_response)

tests/e2e/streaming/handlers/s3_object_handler.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,15 @@ def lambda_handler(event, context):
6666

6767
if transform_zip or transform_zip_lzma:
6868
response["manifest"] = obj.namelist()
69-
response["body"] = obj.read(obj.namelist()[1]).rstrip() # extracts the second file on the zip
69+
response["body"] = (
70+
obj.read(obj.namelist()[1]).rstrip().decode("utf-8")
71+
) # extracts the second file on the zip
7072
elif transform_csv or csv:
7173
response["body"] = obj.__next__()
7274
elif transform_gzip or gunzip:
73-
response["body"] = obj.readline().rstrip()
75+
response["body"] = obj.readline().rstrip().decode("utf-8")
7476
else:
75-
response["body"] = obj.readline().rstrip()
77+
response["body"] = obj.readline().rstrip().decode("utf-8")
7678
except botocore.exceptions.ClientError as e:
7779
if e.response["Error"]["Code"] == "404":
7880
response["error"] = "Not found"

0 commit comments

Comments
 (0)