From a174da3613f548d58433f64cf3c99dd302c6154a Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 10 Dec 2015 20:27:17 -0700 Subject: qemu-iotests: Reduce racy output in 028 On my machine, './check -qcow2 028' was failing about 80% of the time, due to a race in how many times the repeated attempts to run 'info block-jobs' could occur before the job was done, showing up as a failure of fewer '(qemu) ' prompts than in the expected output. Silence the output during the repetitions, then add a final clean command to keep the expected output useful; once patched, I was finally able to run the test 20 times in a row with no failures. Signed-off-by: Eric Blake Reviewed-by: John Snow Signed-off-by: Kevin Wolf --- tests/qemu-iotests/028 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/qemu-iotests/028') diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028 index 009510d..4909b9b 100755 --- a/tests/qemu-iotests/028 +++ b/tests/qemu-iotests/028 @@ -114,10 +114,12 @@ h=$QEMU_HANDLE QEMU_COMM_TIMEOUT=1 # Silence output since it contains the disk image path and QEMU's readline -# character echoing makes it very hard to filter the output +# character echoing makes it very hard to filter the output. Plus, there +# is no telling how many times the command will repeat before succeeding. _send_qemu_cmd $h "drive_backup disk ${TEST_IMG}.copy" "(qemu)" >/dev/null _send_qemu_cmd $h "" "Formatting" | _filter_img_create -qemu_cmd_repeat=20 _send_qemu_cmd $h "info block-jobs" "No active jobs" +qemu_cmd_repeat=20 _send_qemu_cmd $h "info block-jobs" "No active jobs" >/dev/null +_send_qemu_cmd $h "info block-jobs" "No active jobs" _send_qemu_cmd $h 'quit' "" # Base image sectors -- cgit v1.1