diff --git a/deps/wazuh_testing/wazuh_testing/tools/services.py b/deps/wazuh_testing/wazuh_testing/tools/services.py index 546a97ea1c..8f094bc085 100644 --- a/deps/wazuh_testing/wazuh_testing/tools/services.py +++ b/deps/wazuh_testing/wazuh_testing/tools/services.py @@ -88,7 +88,9 @@ def control_service(action, daemon=None, debug_mode=False): for _ in range(error_109_windows_retry): command = subprocess.run(["net", action, "WazuhSvc"], stderr=subprocess.PIPE) result = command.returncode - if result != 0: + if result == 0: + break + else: if action == 'stop' and 'The Wazuh service is not started.' in command.stderr.decode(): result = 0 break