diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bbdb6135a..93a65f9758 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ All notable changes to this project will be documented in this file. ### Fixed +- Include logic to retry package installation if the lock file is currently in use ([#5421](https://github.com/wazuh/wazuh-qa/pull/5421)) \- (Framework) - Increase E2E Vulnerability detection change manager test timeout ([#5414](https://github.com/wazuh/wazuh-qa/pull/5414)) \- (Tests) - Fix filter vulnerabilities function in case of multiple packages are used ([#5419](https://github.com/wazuh/wazuh-qa/pull/5419)) \- (Framework) - Remove false positive from E2E Vulnerability Detection tests ([#5369](https://github.com/wazuh/wazuh-qa/pull/5369)) \- (Framework) diff --git a/deps/wazuh_testing/wazuh_testing/tools/system.py b/deps/wazuh_testing/wazuh_testing/tools/system.py index d935c801b0..30470ec6bd 100644 --- a/deps/wazuh_testing/wazuh_testing/tools/system.py +++ b/deps/wazuh_testing/wazuh_testing/tools/system.py @@ -527,6 +527,9 @@ def install_pkg_package(host, url): retry_installation_errors = [ 'This installation package could not be opened', + 'Could not get lock', + 'error: dpkg frontend lock was locked by another process with pid', + 'yum lockfile is held by another process' ] result = {} @@ -559,12 +562,13 @@ def install_pkg_package(host, url): or not (result.get('changed', False) or result.get('rc') == 0 or result.get('stderr', None) == '') if failed_installation: - if not any(re.search(error, result.get('msg', '')) for error in retry_installation_errors): + if not any(re.search(error, result.get('msg', '')) for error in retry_installation_errors) and \ + not any(re.search(error, result.get('stderr', '')) for error in retry_installation_errors): logging.error("Installation failed. Installation will not be retried.") raise RuntimeError(f"Failed to install package in {host}: {result}") - logging.error(f"Error installing {url} in {host}:" - 'Corrupted package detected. Retrying installation...') + logging.error(f"Error installing {url} in {host}: Retrying installation...") + sleep(retry_delay) else: break