From c122a9aa252ed8f2aa5abf3d92a593902e3e31f3 Mon Sep 17 00:00:00 2001 From: Makito Kano Date: Tue, 23 Apr 2024 23:24:42 +0900 Subject: [PATCH] =?UTF-8?q?DAOS-12974=20test:=20nvme/pool=5Fcapacity.py=20?= =?UTF-8?q?-=20Use=20threads=20to=20create=20contai=E2=80=A6=20(#14126)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test creates 50 containers for each of the 10 pools 20 times (10 x 50 x 20). Creating many containers serially takes significant amount of time, so use threads to create the containers in parallel. Tested the speed up of run_test_create_delete() (Just this method. Not the entire test) with 3 x 50 x 3 and took 732 sec in serial, but only 261 sec in parallel. Also reduce iteration to 2 and reduce timeout. Signed-off-by: Makito Kano --- src/tests/ftest/nvme/pool_capacity.py | 22 +++++++++++++++------- src/tests/ftest/nvme/pool_capacity.yaml | 23 +++++++++++------------ 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/tests/ftest/nvme/pool_capacity.py b/src/tests/ftest/nvme/pool_capacity.py index 4c417aa83a9..f846cad1bc6 100644 --- a/src/tests/ftest/nvme/pool_capacity.py +++ b/src/tests/ftest/nvme/pool_capacity.py @@ -1,5 +1,5 @@ """ - (C) Copyright 2020-2023 Intel Corporation. + (C) Copyright 2020-2024 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ @@ -94,16 +94,24 @@ def run_test_create_delete(self, num_pool=2, num_cont=5, total_count=100): self.log.info("Running test %s", loop_count) offset = loop_count * num_pool for val in range(offset, offset + num_pool): - self.pool.append(self.get_pool(namespace="/run/pool_qty_{}/*".format(num_pool), - properties="reclaim:disabled")) + self.pool.append( + self.get_pool( + namespace="/run/pool_qty_{}/*".format(num_pool), + properties="reclaim:disabled")) display_string = "pool{} space at the Beginning".format(val) self.pool[-1].display_pool_daos_space(display_string) nvme_size_begin[val] = self.pool[-1].get_pool_free_space("NVME") - # To be fixed by DAOS-12974 + threads = [] + # Create containers with threads because we'll be creating many containers, which + # will take too long if we create them serially. for _ in range(num_cont): - # self.get_container(self.pool[-1]) - pass + kwargs = {"pool": self.pool[-1]} + threads.append(threading.Thread(target=self.get_container, kwargs=kwargs)) + for thread in threads: + thread.start() + for thread in threads: + thread.join() m_leak = 0 @@ -214,4 +222,4 @@ def test_nvme_pool_capacity(self): time.sleep(5) # Run Create/delete pool/container self.log.info("Running Test Case 3: Pool/Cont Create/Destroy") - self.run_test_create_delete(10, 50, 20) + self.run_test_create_delete(10, 50, 2) diff --git a/src/tests/ftest/nvme/pool_capacity.yaml b/src/tests/ftest/nvme/pool_capacity.yaml index 9f7ca2a6b7a..135bb746207 100644 --- a/src/tests/ftest/nvme/pool_capacity.yaml +++ b/src/tests/ftest/nvme/pool_capacity.yaml @@ -1,7 +1,7 @@ hosts: test_servers: 2 test_clients: 2 -timeout: 5000 +timeout: 1800 server_config: name: daos_server engines_per_host: 1 @@ -13,15 +13,14 @@ server_config: pool: mode: 146 name: daos_server - control_method: dmg pool_qty_1: - size: "50%" + size: 50% pool_qty_2: - size: "25%" + size: 25% pool_qty_3: - size: "16%" + size: 16% pool_qty_10: - size: "5%" + size: 5% container: type: POSIX control_method: daos @@ -34,15 +33,15 @@ ior: dfs_destroy: false iorflags: ior_flags: - - "-w -r -R -k -G 1" + - -w -r -R -k -G 1 ior_api: - DFS obj_class: - - "SX" + - SX ior_test_sequence: - # - [scmsize, nvmesize, transfersize, blocksize, PASS/FAIL(Expected) ] + # - [scmsize, nvmesize, transfer_size, block_size, PASS/FAIL(Expected) ] # The values are set to be in the multiples of 10. # Values are appx GB. - - ["NA", "NA", 1000000, 500000000, PASS] # [NA, NA, 1M, 512M, PASS] - - ["NA", "NA", 1000000, 3000000000, FAIL] # [NA, NA, 1M, 3G, FAIL] - - ["NA", "NA", 1000000000, 8000000000, PASS] # [NA, NA, 1G, 8G, PASS] + - [NA, NA, 1000000, 500000000, PASS] # [NA, NA, 1M, 512M, PASS] + - [NA, NA, 1000000, 3000000000, FAIL] # [NA, NA, 1M, 3G, FAIL] + - [NA, NA, 1000000000, 8000000000, PASS] # [NA, NA, 1G, 8G, PASS]