From a345a6f8b356896de3181bf767f541913f973400 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Fri, 9 Nov 2018 10:07:55 +0100 Subject: [PATCH] Add possible message to flaky test check (#8989) (#8994) TestCommands.test_modules_test_error relays on the presence of an error message, this error message seems to be different under some circumstances, as seen in CI builds. Add the timeout message already seen, and print logs in case of failure so it is more easy to fix if happens in the future. (cherry picked from commit 4fbcec0fefbdeb9aa7954e0c7c46d1e52536ab0c) --- metricbeat/tests/system/test_cmd.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/metricbeat/tests/system/test_cmd.py b/metricbeat/tests/system/test_cmd.py index fd6b33228334..9f2bc443da12 100644 --- a/metricbeat/tests/system/test_cmd.py +++ b/metricbeat/tests/system/test_cmd.py @@ -136,7 +136,15 @@ def test_modules_test_error(self): extra_args=["test", "modules"]) assert exit_code == 0 - assert self.log_contains("ERROR error making http request") + try: + assert any(( + self.log_contains("ERROR error making http request"), + self.log_contains("ERROR timeout waiting for an event"), + )) + except: + # Print log to help debugging this if error message changes + print self.get_log() + raise assert self.log_contains("cpu...OK") assert self.log_contains("memory...OK")