From b268e613ed05b4238a261da9ebfdf8a61fdb09de Mon Sep 17 00:00:00 2001 From: "a.berezin" Date: Wed, 27 Nov 2024 13:37:17 +0300 Subject: [PATCH] [#332] Remove files for heavy failover test Signed-off-by: a.berezin --- .../testsuites/failovers/test_failover_server.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pytest_tests/testsuites/failovers/test_failover_server.py b/pytest_tests/testsuites/failovers/test_failover_server.py index b9d6afad..482e87ca 100644 --- a/pytest_tests/testsuites/failovers/test_failover_server.py +++ b/pytest_tests/testsuites/failovers/test_failover_server.py @@ -101,12 +101,21 @@ class TestFailoverServer(ClusterTestBase): sizes = sizes_samples + random.choices(sizes_samples, weights=sizes_weights, k=object_count - samples_count) results = parallel( - [container.generate_object for _ in sizes for container in containers], - size=itertools.cycle([size.value for size in sizes]), + [self._generate_files_and_remove_physical_copy for _ in containers], + 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]]: