From e2e4a0c667cde8f658cb134fe8914eeb0e148cbf Mon Sep 17 00:00:00 2001 From: Dmitriy Zayakin Date: Tue, 28 Nov 2023 09:30:21 +0300 Subject: [PATCH] [#160] Add try\except Signed-off-by: Dmitriy Zayakin --- .../failovers/test_failover_server.py | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/pytest_tests/testsuites/failovers/test_failover_server.py b/pytest_tests/testsuites/failovers/test_failover_server.py index aa20306..c1a3e62 100644 --- a/pytest_tests/testsuites/failovers/test_failover_server.py +++ b/pytest_tests/testsuites/failovers/test_failover_server.py @@ -99,20 +99,25 @@ class TestFailoverServer(ClusterTestBase): self, nodes: list[StorageNode], storage_objects: list[StorageObjectInfo] ) -> list[StorageObjectInfo]: corrupted_objects = [] + errors_get = [] for node in nodes: for storage_object in storage_objects: - got_file_path = get_object( - storage_object.wallet_file_path, - storage_object.cid, - storage_object.oid, - endpoint=node.get_rpc_endpoint(), - shell=self.shell, - timeout="60s", - ) - if storage_object.file_hash != get_file_hash(got_file_path): - corrupted_objects.append(storage_object) - os.remove(got_file_path) + try: + got_file_path = get_object( + storage_object.wallet_file_path, + storage_object.cid, + storage_object.oid, + endpoint=node.get_rpc_endpoint(), + shell=self.shell, + timeout="60s", + ) + if storage_object.file_hash != get_file_hash(got_file_path): + corrupted_objects.append(storage_object) + os.remove(got_file_path) + except RuntimeError: + errors_get.append(storage_object.oid) + assert len(errors_get) == 0, f"Get failed - {errors_get}" return corrupted_objects def check_objects_replication(