From d327e8149b4f262d433d2037561026e8659740d0 Mon Sep 17 00:00:00 2001 From: mkadilov Date: Wed, 20 Dec 2023 15:00:53 +0300 Subject: [PATCH] [OBJECT-5670] test_container_creation_deletion_parallel extended test_container_creation_deletion_parallel extended Signed-off-by: Mikhail Kadilov m.kadilov@yadro.com --- .../testsuites/container/test_container.py | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/pytest_tests/testsuites/container/test_container.py b/pytest_tests/testsuites/container/test_container.py index cae08f8a..26769224 100644 --- a/pytest_tests/testsuites/container/test_container.py +++ b/pytest_tests/testsuites/container/test_container.py @@ -86,34 +86,35 @@ class TestContainer(ClusterTestBase): containers_count = 3 wallet = default_wallet placement_rule = "REP 2 IN X CBF 1 SELECT 2 FROM * AS X" + iteration_count = 10 - cids: list[str] = [] - with reporter.step(f"Create {containers_count} containers"): - for _ in range(containers_count): - cids.append( - create_container( + for iteration in range(iteration_count): + cids: list[str] = [] + with reporter.step(f"Create {containers_count} containers"): + for _ in range(containers_count): + cids.append( + create_container( + wallet, + rule=placement_rule, + await_mode=False, + shell=self.shell, + endpoint=self.cluster.default_rpc_endpoint, + wait_for_creation=False, + ) + ) + + with reporter.step("Wait for containers occur in container list"): + for cid in cids: + wait_for_container_creation( wallet, - rule=placement_rule, - await_mode=False, + cid, + sleep_interval=containers_count, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint, - wait_for_creation=False, ) - ) - with reporter.step("Wait for containers occur in container list"): - for cid in cids: - wait_for_container_creation( - wallet, - cid, - sleep_interval=containers_count, - shell=self.shell, - endpoint=self.cluster.default_rpc_endpoint, - ) - - with reporter.step("Delete containers and check they were deleted"): - for cid in cids: - delete_container(wallet, cid, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint) - self.tick_epoch() - for cid in cids: - wait_for_container_deletion(wallet, cid, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint) + with reporter.step("Delete containers and check they were deleted"): + for cid in cids: + delete_container(wallet, cid, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint, await_mode=True) + containers_list = list_containers(wallet, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint) + assert cid not in containers_list, "Container not deleted" -- 2.45.2