summaryrefslogtreecommitdiffstats
path: root/tests/qemu-iotests/041
diff options
context:
space:
mode:
authorKevin Wolf2017-07-21 16:41:21 +0200
committerKevin Wolf2017-07-24 15:06:04 +0200
commit2c93c5cb43fd992038711f84ea34c9373273cda6 (patch)
treed083c65aab2baf5cbec6462338bd5010e55257ae /tests/qemu-iotests/041
parentblock: Skip implicit nodes in query-block/blockstats (diff)
downloadqemu-2c93c5cb43fd992038711f84ea34c9373273cda6.tar.gz
qemu-2c93c5cb43fd992038711f84ea34c9373273cda6.tar.xz
qemu-2c93c5cb43fd992038711f84ea34c9373273cda6.zip
qemu-iotests: Avoid unnecessary sleeps
Test cases 030, 041 and 055 used to sleep for a second after calling block-job-pause to make sure that the block job had time to actually get into paused state. We can instead poll its status and use that one second only as a timeout. The tests also slept a second for checking that the block jobs don't make progress while being paused. Half a second is more than enough for this. These changes reduce the total time for the three tests by 25 seconds on my laptop (from 155 seconds to 130). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/041')
-rwxr-xr-xtests/qemu-iotests/04112
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index 60f09cc175..4cda540735 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -103,14 +103,12 @@ class TestSingleDrive(iotests.QMPTestCase):
target=self.qmp_target)
self.assert_qmp(result, 'return', {})
- result = self.vm.qmp('block-job-pause', device='drive0')
- self.assert_qmp(result, 'return', {})
+ self.pause_job('drive0')
- time.sleep(1)
result = self.vm.qmp('query-block-jobs')
offset = self.dictpath(result, 'return[0]/offset')
- time.sleep(1)
+ time.sleep(0.5)
result = self.vm.qmp('query-block-jobs')
self.assert_qmp(result, 'return[0]/offset', offset)
@@ -896,14 +894,12 @@ class TestRepairQuorum(iotests.QMPTestCase):
target=quorum_repair_img, format=iotests.imgfmt)
self.assert_qmp(result, 'return', {})
- result = self.vm.qmp('block-job-pause', device='job0')
- self.assert_qmp(result, 'return', {})
+ self.pause_job('job0')
- time.sleep(1)
result = self.vm.qmp('query-block-jobs')
offset = self.dictpath(result, 'return[0]/offset')
- time.sleep(1)
+ time.sleep(0.5)
result = self.vm.qmp('query-block-jobs')
self.assert_qmp(result, 'return[0]/offset', offset)