Skip to content

Commit

Permalink
misc: run stress test within a subdirectory
Browse files Browse the repository at this point in the history
This will help with clean up post the test.

Signed-off-by: Sachin Prabhu <[email protected]>
  • Loading branch information
spuiuk committed Jan 22, 2024
1 parent deb7b45 commit f5c7897
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions testcases/misc/test_stress.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
import threading
import testhelper
import shutil
from pathlib import Path
from .conftest import gen_params, gen_params_premounted

Expand Down Expand Up @@ -46,16 +47,22 @@ def _stress_test(


def _run_stress_tests(directory: Path) -> None:
_stress_test(
directory, num_clients=20, num_operations=40, file_size=2**25
)
directory.mkdir(exist_ok=True)
try:
_stress_test(
directory, num_clients=20, num_operations=40, file_size=2**25
)
finally:
shutil.rmtree(directory, ignore_errors=True)


@pytest.mark.parametrize("setup_mount", gen_params(), indirect=True)
def test_check_mnt_stress(setup_mount: Path) -> None:
_run_stress_tests(setup_mount)
base = setup_mount / "stress-test"
_run_stress_tests(base)


@pytest.mark.parametrize("test_dir", gen_params_premounted())
def test_check_mnt_stress_premounted(test_dir: Path) -> None:
_run_stress_tests(test_dir)
base = test_dir / "stress-test"
_run_stress_tests(base)

0 comments on commit f5c7897

Please sign in to comment.