diff --git a/tests/integration/buildcmd/build_integ_base.py b/tests/integration/buildcmd/build_integ_base.py index ab82a5c86a..9a4473bdc0 100644 --- a/tests/integration/buildcmd/build_integ_base.py +++ b/tests/integration/buildcmd/build_integ_base.py @@ -241,11 +241,23 @@ def _verify_invoke_built_function(self, template_path, function_logical_id, over overrides, ] - process_execute = run_command(cmdlist) - process_execute.process.wait() + for i in range(5): + process_execute = run_command(cmdlist) + process_stdout = process_execute.stdout.decode("utf-8") + process_stderr = process_execute.stderr.decode("utf-8") + LOG.info("Local invoke stdout: %s", process_stdout) + LOG.info("Local invoke stderr: %s", process_stderr) + + if "timed out after" in process_stderr: + LOG.info("Function timed out, retrying") + continue + + if json.loads(process_stdout) == expected_result: + LOG.info("Expected result found, succeeded!") + # success + return - process_stdout = process_execute.stdout.decode("utf-8") - self.assertEqual(json.loads(process_stdout), expected_result) + self.fail("Failed to invoke function & get expected result") def get_override(self, runtime, code_uri, architecture, handler): overrides = {"Runtime": runtime, "CodeUri": code_uri, "Handler": handler} diff --git a/tests/integration/testdata/buildcmd/template_with_architecture.yaml b/tests/integration/testdata/buildcmd/template_with_architecture.yaml index b7bb9a92b0..fcaab7a3ab 100644 --- a/tests/integration/testdata/buildcmd/template_with_architecture.yaml +++ b/tests/integration/testdata/buildcmd/template_with_architecture.yaml @@ -19,7 +19,7 @@ Resources: Handler: !Ref Handler Runtime: !Ref Runtime CodeUri: !Ref CodeUri - Timeout: 600 + Timeout: 60 Architectures: - !Ref Architectures