Skip to content

Commit

Permalink
blockdev_mirror_stress:not run stress test as a thread
Browse files Browse the repository at this point in the history
When running stress test as a thread, we usually hit
resource lock issue, so some processes hang there even
though test has finished and vm quit successfully,this
will block all the tests in a loop.

Signed-off-by: Aihua Liang <[email protected]>
  • Loading branch information
aliang123 committed Aug 15, 2024
1 parent 9845a43 commit f7aa2e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 2 additions & 6 deletions qemu/tests/blockdev_mirror_stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
import time
import random

from virttest import utils_test

from provider.storage_benchmark import generate_instance
from provider.blockdev_mirror_wait import BlockdevMirrorWaitTest


class BlockdevMirrorStressTest(BlockdevMirrorWaitTest):
"""Do block-mirror with fio test as background test"""

def fio_thread(self):
def fio_run_bg(self):
fio_options = self.params.get("fio_options")
if fio_options:
self.test.log.info("Start to run fio")
Expand All @@ -38,9 +36,7 @@ def remove_files_from_system_image(self, tmo=60):
session.close()

def do_test(self):
bg_test = utils_test.BackgroundTest(self.fio_thread, "")
bg_test.thread.daemon = True
bg_test.start()
self.fio_run_bg()
self.test.log.info("sleep random time before mirror during fio")
mint = self.params.get_numeric("sleep_min")
maxt = self.params.get_numeric("sleep_max")
Expand Down
1 change: 1 addition & 0 deletions qemu/tests/cfg/blockdev_mirror_stress.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
fio_timeout = 300
fio_options = '--name=stress --filename=${mnt_on_sys_dsk}/${file_fio} --ioengine=libaio --rw=write --direct=1 '
fio_options += '--bs=4K --size=2G --iodepth=256 --numjobs=256 --runtime=${fio_timeout} --time_based'
fio_options += ' --output=/tmp/fio_report.txt &'
sync = full
storage_pools = default
storage_pool = default
Expand Down

0 comments on commit f7aa2e4

Please sign in to comment.