From f6438c5b9375ef89753f508b2235335bad33cd6f Mon Sep 17 00:00:00 2001 From: mkadilov Date: Fri, 1 Dec 2023 23:35:31 +0300 Subject: [PATCH] [#163] Added log exception Added log exception Signed-off-by: Mikhail Kadilov --- pytest_tests/testsuites/special/test_logs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pytest_tests/testsuites/special/test_logs.py b/pytest_tests/testsuites/special/test_logs.py index fd3a37a0..d39f7501 100644 --- a/pytest_tests/testsuites/special/test_logs.py +++ b/pytest_tests/testsuites/special/test_logs.py @@ -36,9 +36,10 @@ class TestLogs: os.makedirs(logs_dir) # Using \b here because 'oom' and 'panic' can sometimes be found in OID or CID issues_regex = r"\bpanic\b|\boom\b|too many|insufficient funds|insufficient amount of gas|wallet passwd|secret key|access key" + exclude_filter = r"too many requests" futures = parallel( - self._collect_logs_on_host, cluster.hosts, logs_dir, issues_regex, session_start_time, end_time + self._collect_logs_on_host, cluster.hosts, logs_dir, issues_regex, session_start_time, end_time, exclude_filter ) hosts_with_problems = [ @@ -51,9 +52,9 @@ class TestLogs: not hosts_with_problems ), f"The following hosts contains contain critical errors in system logs: {', '.join(hosts_with_problems)}" - def _collect_logs_on_host(self, host: Host, logs_dir: str, regex: str, since: datetime, until: datetime): + def _collect_logs_on_host(self, host: Host, logs_dir: str, regex: str, since: datetime, until: datetime, exclude_filter: str): with reporter.step(f"Get logs from {host.config.address}"): - logs = host.get_filtered_logs(regex, since, until) + logs = host.get_filtered_logs(regex, since, until, exclude_filter) if not logs: return None