qtest.py: Wait for the result of qtest commands
commita5df73baaf27a2aa4a911545ee1ee6286a5372e4
authorAlberto Garcia <berto@igalia.com>
Thu, 31 Jan 2019 12:38:10 +0000 (31 14:38 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 1 Feb 2019 12:46:45 +0000 (1 13:46 +0100)
treec2fe8a28c865e8556a058b1994b18fb723849b25
parent78fc3b3a26c145eebcdee992988644974b243a74
qtest.py: Wait for the result of qtest commands

The cmd() method of the QEMUQtestProtocol class sends a qtest command
to QEMU but doesn't wait for the return message ("OK", "FAIL", "ERR").
Because of this, it can return control to the caller before the
command has actually finished.

In cases like clock_step or clock_set this means that cmd() can return
before all the timers triggered by the clock change have been fired.
This can be fixed by making cmd() wait for the output of the qtest
command.

This fixes iotests 093 and 136, which are flaky since commit
8258292e18c39480b64eba9f3551 when the machine is under heavy workload.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scripts/qtest.py