From 70416d40c216edbe561cae42fc0656ee5356e6e8 Mon Sep 17 00:00:00 2001 From: Vladimir Avdeev Date: Thu, 18 May 2023 09:55:12 +0300 Subject: [PATCH] Add optional parameter "no wait for return" in panic_reboot_host --- .../storage/controllers/cluster_state_controller.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/frostfs_testlib/storage/controllers/cluster_state_controller.py b/src/frostfs_testlib/storage/controllers/cluster_state_controller.py index 23d1a6c..35072f2 100644 --- a/src/frostfs_testlib/storage/controllers/cluster_state_controller.py +++ b/src/frostfs_testlib/storage/controllers/cluster_state_controller.py @@ -94,18 +94,19 @@ class ClusterStateController: @run_optionally(optionals.OPTIONAL_FAILOVER_ENABLED) @reporter.step_deco("Hard reboot host {node} via magic SysRq option") - def panic_reboot_host(self, node: ClusterNode): + def panic_reboot_host(self, node: ClusterNode, wait_for_return: bool = True): shell = node.host.get_shell() shell.exec('sudo sh -c "echo 1 > /proc/sys/kernel/sysrq"') options = CommandOptions(close_stdin=True, timeout=1, check=False) shell.exec('sudo sh -c "echo b > /proc/sysrq-trigger"', options) - # Let the things to be settled - # A little wait here to prevent ssh stuck during panic - time.sleep(10) - wait_for_host_online(self.shell, node.storage_node) - wait_for_node_online(node.storage_node) + if wait_for_return: + # Let the things to be settled + # A little wait here to prevent ssh stuck during panic + time.sleep(10) + wait_for_host_online(self.shell, node.storage_node) + wait_for_node_online(node.storage_node) @reporter.step_deco("Wait up to {timeout} seconds for nodes on cluster to align epochs") def wait_for_epochs_align(self, timeout=60):