From 453286d459c756ff74f38a02278c75c2b715fde1 Mon Sep 17 00:00:00 2001 From: "a.berezin" Date: Wed, 27 Nov 2024 13:50:45 +0300 Subject: [PATCH] [#332] Remove files for heavy failover test Signed-off-by: a.berezin --- .../failovers/test_failover_server.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pytest_tests/testsuites/failovers/test_failover_server.py b/pytest_tests/testsuites/failovers/test_failover_server.py index b9d6afa..8064f7f 100644 --- a/pytest_tests/testsuites/failovers/test_failover_server.py +++ b/pytest_tests/testsuites/failovers/test_failover_server.py @@ -99,14 +99,25 @@ class TestFailoverServer(ClusterTestBase): sizes_weights = [2, 1] sizes = sizes_samples + random.choices(sizes_samples, weights=sizes_weights, k=object_count - samples_count) + total_objects = len(containers) * object_count - results = parallel( - [container.generate_object for _ in sizes for container in containers], - size=itertools.cycle([size.value for size in sizes]), - ) + with reporter.step(f"Upload {total_objects} in total to containers"): + results = parallel( + [self._generate_files_and_remove_physical_copy for _ in range(total_objects)], + container=itertools.cycle(containers), + size=itertools.cycle(sizes), + ) return [result.result() for result in results] + def _generate_files_and_remove_physical_copy(self, container: StorageContainer, size: ObjectSize) -> StorageObjectInfo: + storage_object = container.generate_object(size.value) + + # Deliberately remove physical copy of the file for this test since it can generate multibytes of test objects + os.remove(storage_object.file_path) + + return storage_object + @allure.title("[Test] Create objects and get nodes with object") @pytest.fixture() def object_and_nodes(self, simple_object_size: ObjectSize, container: StorageContainer) -> tuple[StorageObjectInfo, list[ClusterNode]]: