Skip to content

fix(e2e): fix test brittleness #2152

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

Merged
merged 2 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/e2e/idempotency/test_idempotency_dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
8 changes: 5 additions & 3 deletions tests/e2e/streaming/handlers/s3_object_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down