Skip to content

Commit

Permalink
Consolidate tests and fix intermittent failures (#10958)
Browse files Browse the repository at this point in the history
- Combined test_run_io_multiple_dc_pods.py and test_run_io_multiple_pods.py
 - Fixed intermittent failures in test_raw_block_pv and test_create_resize_delete_pvc for improved stability

Signed-off-by: Sidhant Agrawal <[email protected]>
  • Loading branch information
sidhant-agrawal authored Dec 5, 2024
1 parent e17d1e9 commit c402bca
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 79 deletions.
3 changes: 3 additions & 0 deletions tests/functional/pv/pv_services/test_raw_block_pv.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def raw_block_pv(self):
storage_type=storage_type,
size=f"{random.randint(10,200)}M",
invalidate=0,
direct=1,
)
for pod in pvc_gb_pods:
log.info(f"running io on pod {pod.name}")
Expand All @@ -142,6 +143,7 @@ def raw_block_pv(self):
storage_type=storage_type,
size=f"{random.randint(1,5)}G",
invalidate=0,
direct=1,
)
for pod in pvc_tb_pods:
log.info(f"running io on pod {pod.name}")
Expand All @@ -150,6 +152,7 @@ def raw_block_pv(self):
storage_type=storage_type,
size=f"{random.randint(10,15)}G",
invalidate=0,
direct=1,
)

for pod in pods:
Expand Down
73 changes: 0 additions & 73 deletions tests/functional/pv/pv_services/test_run_io_multiple_dc_pods.py

This file was deleted.

15 changes: 10 additions & 5 deletions tests/functional/pv/pv_services/test_run_io_multiple_pods.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from ocs_ci.ocs.resources.pod import get_fio_rw_iops
from ocs_ci.ocs import constants
from ocs_ci.framework.pytest_customization.marks import green_squad, provider_mode
Expand All @@ -22,11 +23,11 @@ class TestIOMultiplePods(ManageTest):
Run IO on multiple pods in parallel
"""

num_of_pvcs = 10
num_of_pvcs = 6
pvc_size = 5

@pytest.fixture()
def pods(self, interface, pod_factory, multi_pvc_factory):
def pods(self, interface, multi_pvc_factory, pod_factory, dc_pod_factory):
"""
Prepare multiple pods for the test
Expand All @@ -39,16 +40,20 @@ def pods(self, interface, pod_factory, multi_pvc_factory):
)

pod_objs = list()
for pvc_obj in pvc_objs:
pod_objs.append(pod_factory(pvc=pvc_obj))
for pvc_obj in pvc_objs[: len(pvc_objs) // 2]:
pod_objs.append(dc_pod_factory(interface=interface, pvc=pvc_obj))

for pvc_obj in pvc_objs[len(pvc_objs) // 2 :]:
pod_objs.append(pod_factory(interface=interface, pvc=pvc_obj))

return pod_objs

def test_run_io_multiple_pods(self, pods):
"""
Run IO on multiple pods in parallel
"""
for pod in pods:
pod.run_io("fs", f"{self.pvc_size - 1}G")
pod.run_io(storage_type="fs", size="1G")

for pod in pods:
get_fio_rw_iops(pod)
7 changes: 6 additions & 1 deletion tests/functional/ui/test_pvc_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ def test_create_resize_delete_pvc(
else:
storage_type = constants.WORKLOAD_STORAGE_TYPE_FS

new_pod.run_io(storage_type, size=(new_size - 1), invalidate=0, rate="1000m")
new_pod.run_io(
storage_type,
size=(new_size - 1),
invalidate=0,
direct=int(storage_type == "block"),
)

get_fio_rw_iops(new_pod)
logger.info("FIO execution on Pod successfully completed..!!")
Expand Down

0 comments on commit c402bca

Please sign in to comment.