Merge "Do not fail if no unreplied pings are found after reboot"

This commit is contained in:
Zuul 2025-01-22 11:31:16 +00:00 committed by Gerrit Code Review
commit 7455a39f79

View File

@ -55,8 +55,15 @@ def reboot_host(ssh_client: ssh.SSHClientFixture,
method=method) method=method)
tobiko.setup_fixture(reboot) tobiko.setup_fixture(reboot)
if wait: if wait:
# when pings are not replied, we consider the reboot operation started try:
ping.wait_for_ping_hosts([ssh_client.host], check_unreachable=True) # when pings are not replied, the reboot operation starts
# in some cases the reboot is fast enough and no pings are
# unreplied - do not fail in such a case and check uptime instead
ping.wait_for_ping_hosts([ssh_client.host],
check_unreachable=True,
retry_timeout=30.)
except ping.ReachableHostsException:
LOG.exception("no unreplied pings were found - let's check uptime")
reboot.wait_for_operation() reboot.wait_for_operation()
return reboot return reboot