[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 10/10] tests/qemu-iotests/030: test_stream_parallel should use
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v2 10/10] tests/qemu-iotests/030: test_stream_parallel should use auto_finalize=False |
Date: |
Mon, 14 Mar 2022 09:18:54 -0400 |
First, use run_job() instead of the current logic to run the
stream job. Then, use auto_finalize=False to be sure that
the job is not automatically deleted once it is done.
In this way, if the job finishes before we want, it is not
finalized yet so the other commands can still execute
without failing. run_job() will then take care of calling
job-finalize.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Suggested-by: Kevin Wolf <kwolf@redhat.com>
---
tests/qemu-iotests/030 | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 567bf1da67..951c28878c 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -248,7 +248,7 @@ class TestParallelOps(iotests.QMPTestCase):
pending_jobs.append(job_id)
result = self.vm.qmp('block-stream', device=node_name,
job_id=job_id, bottom=f'node{i-1}',
- speed=1024)
+ speed=1024, auto_finalize=False)
self.assert_qmp(result, 'return', {})
# Do this in reverse: After unthrottling them, some jobs may finish
@@ -264,14 +264,8 @@ class TestParallelOps(iotests.QMPTestCase):
result = self.vm.qmp('block-job-set-speed', device=job, speed=0)
self.assert_qmp(result, 'return', {})
- # Wait for all jobs to be finished.
- while len(pending_jobs) > 0:
- for event in self.vm.get_qmp_events(wait=True):
- if event['event'] == 'BLOCK_JOB_COMPLETED':
- job_id = self.dictpath(event, 'data/device')
- self.assertTrue(job_id in pending_jobs)
- self.assert_qmp_absent(event, 'data/error')
- pending_jobs.remove(job_id)
+ for job in pending_jobs:
+ self.vm.run_job(job=job, auto_finalize=False)
self.assert_no_active_block_jobs()
self.vm.shutdown()
--
2.31.1
- [PATCH v2 00/10] block: bug fixes in preparation of AioContext removal, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v2 03/10] block/io.c: fix bdrv_child_cb_drained_begin invocations from a coroutine, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v2 07/10] test-bdrv-drain.c: remove test_detach_by_parent_cb(), Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v2 06/10] test-bdrv-drain.c: adapt test to support additional subtree drains, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v2 05/10] block.c: bdrv_replace_child_noperm: first call ->attach(), and then add child, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v2 01/10] drains: create bh only when polling, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v2 09/10] child_job_drained_poll: override polling condition only when in home thread, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v2 10/10] tests/qemu-iotests/030: test_stream_parallel should use auto_finalize=False,
Emanuele Giuseppe Esposito <=
- [PATCH v2 02/10] bdrv_parent_drained_begin_single: handle calls from coroutine context, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v2 08/10] tests/unit/test-bdrv-drain.c: graph setup functions can't run in coroutines, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v2 04/10] block.c: bdrv_replace_child_noperm: first remove the child, and then call ->detach(), Emanuele Giuseppe Esposito, 2022/03/14