[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/15] tests/qemu-iotests/030: test_stream_parallel should use au
From: |
Paolo Bonzini |
Subject: |
[PATCH 06/15] tests/qemu-iotests/030: test_stream_parallel should use auto_finalize=False |
Date: |
Mon, 12 Dec 2022 13:59:11 +0100 |
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
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>
Message-Id: <20220314131854.2202651-11-eesposit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@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 98595d47fec3..e5c13cb5fe4c 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -256,7 +256,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
@@ -272,14 +272,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.38.1
- [PATCH 00/12] More cleanups and fixes for drain, Paolo Bonzini, 2022/12/12
- [PATCH 01/15] Revert "block: Remove poll parameter from bdrv_parent_drained_begin_single()", Paolo Bonzini, 2022/12/12
- [PATCH 02/15] Revert "block: Don't poll in bdrv_replace_child_noperm()", Paolo Bonzini, 2022/12/12
- [PATCH 03/15] block: Pull polling out of bdrv_parent_drained_begin_single(), Paolo Bonzini, 2022/12/12
- [PATCH 04/15] test-bdrv-drain.c: remove test_detach_by_parent_cb(), Paolo Bonzini, 2022/12/12
- [PATCH 05/15] tests/unit/test-bdrv-drain.c: graph setup functions can't run in coroutines, Paolo Bonzini, 2022/12/12
- [PATCH 06/15] tests/qemu-iotests/030: test_stream_parallel should use auto_finalize=False,
Paolo Bonzini <=
- [PATCH 07/15] block-backend: enter aio coroutine only after drain, Paolo Bonzini, 2022/12/12
- [PATCH 08/15] nbd: a BlockExport always has a BlockBackend, Paolo Bonzini, 2022/12/12
- [PATCH 09/15] block-backend: make global properties write-once, Paolo Bonzini, 2022/12/12
- [PATCH 11/15] block-backend: make queued_requests thread-safe, Paolo Bonzini, 2022/12/12
- [PATCH 10/15] block-backend: always wait for drain before starting operation, Paolo Bonzini, 2022/12/12
- [PATCH 12/15] block: limit bdrv_co_yield_to_drain to drain_begin, Paolo Bonzini, 2022/12/12
- [PATCH 15/15] block: only get out of coroutine context for polling, Paolo Bonzini, 2022/12/12
- [PATCH 13/15] block: second argument of bdrv_do_drained_end is always NULL, Paolo Bonzini, 2022/12/12
- [PATCH 14/15] block: second argument of bdrv_do_drained_begin and bdrv_drain_poll is always NULL, Paolo Bonzini, 2022/12/12