From 2d174831ab04bcaaea5438a16441a4980682aa5b Mon Sep 17 00:00:00 2001 From: Dmitriy Zayakin Date: Fri, 19 May 2023 15:26:15 +0300 Subject: [PATCH] Add wait block for tick epoch and add version testlib Signed-off-by: Dmitriy Zayakin --- .../testsuites/failovers/test_failover_server.py | 15 +++++++++------ requirements.txt | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pytest_tests/testsuites/failovers/test_failover_server.py b/pytest_tests/testsuites/failovers/test_failover_server.py index 765e965..f88df65 100644 --- a/pytest_tests/testsuites/failovers/test_failover_server.py +++ b/pytest_tests/testsuites/failovers/test_failover_server.py @@ -186,12 +186,15 @@ class TestFailoverServer(ClusterTestBase): node_to_stop.storage_node, self.shell, alive_node=storage_nodes[0] ) - count_tick_epoch = alive_nodes[0].ir_node.get_netmap_cleaner_threshold() + 1 - with allure.step(f"Tick {count_tick_epoch} epoch, in {storage_nodes[0]} node"): - self.tick_epochs(count_tick_epoch, storage_nodes[0]) + count_tick_epoch = alive_nodes[0].ir_node.get_netmap_cleaner_threshold() + 2 - with allure.step("Wait 2 block time"): - time.sleep(datetime_utils.parse_time(MORPH_BLOCK_TIME) * 2) + with allure.step(f"Tick {count_tick_epoch} epoch, in {storage_nodes[0]} node"): + for tick in range(count_tick_epoch): + self.tick_epoch(storage_nodes[0]) + time.sleep(datetime_utils.parse_time(MORPH_BLOCK_TIME) * 2) + + with allure.step(f"Check if the node {node_to_stop.storage_node} has stopped"): + wait_for_host_offline(self.shell, node_to_stop.storage_node) with allure.step(f"Check {node_to_stop} in not map"): self.wait_node_not_in_map( @@ -205,7 +208,7 @@ class TestFailoverServer(ClusterTestBase): assert not corrupted_objects_list @allure.title("Temporarily disable a node") - @pytest.mark.parametrize("containers, storage_objects", [(1, 2)], indirect=True) + @pytest.mark.parametrize("containers, storage_objects", [(5, 20)], indirect=True) def test_temporarily_disable_a_node( self, containers: list[StorageContainer], diff --git a/requirements.txt b/requirements.txt index 6d84b1f..d01cc1a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ base58==2.1.0 boto3==1.16.33 botocore==1.19.33 configobj==5.0.6 -frostfs-testlib==2.0.0 +frostfs-testlib>=2.0.1 neo-mamba==1.0.0 pexpect==4.8.0 pyyaml==6.0