From 8a48402f5375ace1989c8fb8e78538deed1c84a8 Mon Sep 17 00:00:00 2001 From: anikeev-yadro Date: Fri, 21 Oct 2022 17:53:54 +0300 Subject: [PATCH] Fix failover tests Signed-off-by: anikeev-yadro --- .../testsuites/failovers/test_failover_storage.py | 8 ++++---- robot/resources/lib/python_keywords/failover_utils.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pytest_tests/testsuites/failovers/test_failover_storage.py b/pytest_tests/testsuites/failovers/test_failover_storage.py index 1a0334c..cafc6d0 100644 --- a/pytest_tests/testsuites/failovers/test_failover_storage.py +++ b/pytest_tests/testsuites/failovers/test_failover_storage.py @@ -64,13 +64,13 @@ def test_lose_storage_node_host( with allure.step(f"Stop host {host_address}"): host.stop_host("hard" if hard_reboot else "soft") - new_nodes = wait_object_replication_on_nodes( - wallet, cid, oid, 2, shell=client_shell, excluded_nodes=[node_endpoint] - ) + new_nodes = wait_object_replication_on_nodes( + wallet, cid, oid, 2, shell=client_shell, excluded_nodes=[node_endpoint] + ) assert all(old_node not in new_nodes for old_node in node_endpoints) with allure.step("Check object data is not corrupted"): - got_file_path = get_object(wallet, cid, oid, endpoint=new_nodes[0]) + got_file_path = get_object(wallet, cid, oid, endpoint=new_nodes[0], shell=client_shell) assert get_file_hash(source_file_path) == get_file_hash(got_file_path) with allure.step(f"Return all hosts"): diff --git a/robot/resources/lib/python_keywords/failover_utils.py b/robot/resources/lib/python_keywords/failover_utils.py index 861e280..109beaa 100644 --- a/robot/resources/lib/python_keywords/failover_utils.py +++ b/robot/resources/lib/python_keywords/failover_utils.py @@ -26,7 +26,7 @@ def wait_object_replication_on_nodes( nodes = [] for __attempt in range(attempts): nodes = get_nodes_with_object(wallet, cid, oid, shell=shell, skip_nodes=excluded_nodes) - if len(nodes) == expected_copies: + if len(nodes) >= expected_copies: return nodes sleep(sleep_interval) raise AssertionError(