Fix failover tests

Signed-off-by: anikeev-yadro <a.anikeev@yadro.com>
This commit is contained in:
anikeev-yadro 2022-10-21 17:53:54 +03:00 committed by anikeev-yadro
parent 5cab1ecf19
commit 8a48402f53
2 changed files with 5 additions and 5 deletions

View file

@ -64,13 +64,13 @@ def test_lose_storage_node_host(
with allure.step(f"Stop host {host_address}"): with allure.step(f"Stop host {host_address}"):
host.stop_host("hard" if hard_reboot else "soft") host.stop_host("hard" if hard_reboot else "soft")
new_nodes = wait_object_replication_on_nodes( new_nodes = wait_object_replication_on_nodes(
wallet, cid, oid, 2, shell=client_shell, excluded_nodes=[node_endpoint] 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) assert all(old_node not in new_nodes for old_node in node_endpoints)
with allure.step("Check object data is not corrupted"): 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) assert get_file_hash(source_file_path) == get_file_hash(got_file_path)
with allure.step(f"Return all hosts"): with allure.step(f"Return all hosts"):

View file

@ -26,7 +26,7 @@ def wait_object_replication_on_nodes(
nodes = [] nodes = []
for __attempt in range(attempts): for __attempt in range(attempts):
nodes = get_nodes_with_object(wallet, cid, oid, shell=shell, skip_nodes=excluded_nodes) 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 return nodes
sleep(sleep_interval) sleep(sleep_interval)
raise AssertionError( raise AssertionError(