From 9433065fc8ef128bd55226f1d9be1c9838597e45 Mon Sep 17 00:00:00 2001 From: Vihas Makwana Date: Tue, 23 Jul 2024 20:57:58 +0530 Subject: [PATCH] chore: update tests --- metricbeat/module/system/test_system.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/metricbeat/module/system/test_system.py b/metricbeat/module/system/test_system.py index c61598566bad..e6a61756533a 100644 --- a/metricbeat/module/system/test_system.py +++ b/metricbeat/module/system/test_system.py @@ -423,6 +423,9 @@ def test_process(self): found_cmdline = False for evt in output: + if evt.get("error", None) is not None: + # errors are non-fatal errors logged by system/process. Ignore and proceed furture + continue process = evt["system"]["process"] # Not all process will have 'cmdline' due to permission issues, # especially on Windows. Therefore we ensure at least some of @@ -481,6 +484,9 @@ def test_process_unix(self): found_env = False found_cwd = not sys.platform.startswith("linux") for evt in output: + if evt.get("error", None) is not None: + # errors are non-fatal errors logged by system/process. Ignore and proceed furture + continue found_cwd |= "working_directory" in evt["process"] process = evt["system"]["process"]