From 7ff60683e09a2d4ac72f962581186012582339d7 Mon Sep 17 00:00:00 2001 From: Brian Pandola Date: Fri, 15 Jan 2021 06:42:35 -0800 Subject: [PATCH] Expose contextual data when Lambda test fails (#3590) This test is flaky, but when it fails we don't get any indication as to why. This commit ensures that the reason for failure will be part of the assertion message. Once we have information about why this test fails, we can troubleshoot further and hopefully come up with a permanent fix. --- tests/test_awslambda/test_lambda.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_awslambda/test_lambda.py b/tests/test_awslambda/test_lambda.py index 0e1e284a..89dc3cf1 100644 --- a/tests/test_awslambda/test_lambda.py +++ b/tests/test_awslambda/test_lambda.py @@ -125,6 +125,9 @@ def test_invoke_requestresponse_function(): LogType="Tail", ) + if "FunctionError" in success_result: + assert False, success_result["Payload"].read().decode("utf-8") + success_result["StatusCode"].should.equal(200) logs = base64.b64decode(success_result["LogResult"]).decode("utf-8")