[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 08/20] iotests: Fix intermittent failure in 219
From: |
Max Reitz |
Subject: |
[Qemu-block] [PULL 08/20] iotests: Fix intermittent failure in 219 |
Date: |
Fri, 14 Jun 2019 15:40:09 +0200 |
In 219, we wait for the job to make progress before we emit its status.
This makes the output reliable. We do not wait for any more progress if
the job's current-progress already matches its total-progress.
Unfortunately, there is a bug: Right after the job has been started,
it's possible that total-progress is still 0. In that case, we may skip
the first progress-making step and keep ending up 64 kB short.
To fix that bug, we can simply wait for total-progress to reach 4 MB
(the image size) after starting the job.
Reported-by: Karen Mezick <address@hidden>
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1686651
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: John Snow <address@hidden>
[mreitz: Adjusted commit message as per John's proposal]
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/219 | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/219 b/tests/qemu-iotests/219
index c03bbdb294..e0c51662c0 100755
--- a/tests/qemu-iotests/219
+++ b/tests/qemu-iotests/219
@@ -23,6 +23,8 @@ import iotests
iotests.verify_image_format(supported_fmts=['qcow2'])
+img_size = 4 * 1024 * 1024
+
def pause_wait(vm, job_id):
with iotests.Timeout(3, "Timeout waiting for job to pause"):
while True:
@@ -62,6 +64,8 @@ def test_pause_resume(vm):
iotests.log(vm.qmp('query-jobs'))
def test_job_lifecycle(vm, job, job_args, has_ready=False):
+ global img_size
+
iotests.log('')
iotests.log('')
iotests.log('Starting block job: %s (auto-finalize: %s; auto-dismiss: %s)'
%
@@ -84,6 +88,10 @@ def test_job_lifecycle(vm, job, job_args, has_ready=False):
iotests.log(iotests.filter_qmp_event(vm.event_wait('JOB_STATUS_CHANGE')))
iotests.log(iotests.filter_qmp_event(vm.event_wait('JOB_STATUS_CHANGE')))
+ # Wait for total-progress to stabilize
+ while vm.qmp('query-jobs')['return'][0]['total-progress'] < img_size:
+ pass
+
# RUNNING state:
# pause/resume should work, complete/finalize/dismiss should error out
iotests.log('')
@@ -173,9 +181,8 @@ with iotests.FilePath('disk.img') as disk_path, \
iotests.FilePath('copy.img') as copy_path, \
iotests.VM() as vm:
- img_size = '4M'
- iotests.qemu_img_create('-f', iotests.imgfmt, disk_path, img_size)
- iotests.qemu_io('-c', 'write 0 %s' % (img_size),
+ iotests.qemu_img_create('-f', iotests.imgfmt, disk_path, str(img_size))
+ iotests.qemu_io('-c', 'write 0 %i' % (img_size),
'-f', iotests.imgfmt, disk_path)
iotests.log('Launching VM...')
--
2.21.0
- [Qemu-block] [PULL 00/20] Block patches, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 01/20] blockdev-backup: don't check aio_context too early, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 04/20] iotests.py: rewrite run_job to be pickier, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 02/20] iotests.py: do not use infinite waits, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 06/20] event_match: always match on None value, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 08/20] iotests: Fix intermittent failure in 219,
Max Reitz <=
- [Qemu-block] [PULL 07/20] iotests: Filter 175's allocation information, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 03/20] QEMUMachine: add events_wait method, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 05/20] iotests: add iotest 256 for testing blockdev-backup across iothread contexts, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 09/20] hw/block/fdc: floppy command FIFO memory initialization, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 10/20] iotests: restrict 254 to support only qcow2, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 12/20] qapi/block-core: Overlays are not snapshots, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 11/20] qemu-img: Fix options leakage in img_rebase(), Max Reitz, 2019/06/14
- [Qemu-block] [PULL 14/20] qemu-img: Move quiet into ImgConvertState, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 13/20] blockdev: Overlays are not snapshots, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 15/20] qemu-img: Add salvaging mode to convert, Max Reitz, 2019/06/14