From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7ENN-0006jI-0l for qemu-devel@nongnu.org; Thu, 10 Dec 2015 22:28:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7ENJ-0000nh-PE for qemu-devel@nongnu.org; Thu, 10 Dec 2015 22:28:08 -0500 Received: from resqmta-po-12v.sys.comcast.net ([96.114.154.171]:58179) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7ENJ-0000mR-Kh for qemu-devel@nongnu.org; Thu, 10 Dec 2015 22:28:05 -0500 From: Eric Blake Date: Thu, 10 Dec 2015 20:27:17 -0700 Message-Id: <1449804437-30373-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH for-2.5?] qemu-iotests: Reduce racy output in 028 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , "open list:Block layer core" 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 --- Not sure if this is the best fix, or if it is even appropriate for inclusion in 2.5 this late in the game. tests/qemu-iotests/028 | 6 ++++-- tests/qemu-iotests/028.out | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028 index a1f4423..756c335 100755 --- a/tests/qemu-iotests/028 +++ b/tests/qemu-iotests/028 @@ -111,10 +111,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 diff --git a/tests/qemu-iotests/028.out b/tests/qemu-iotests/028.out index 29c9972..e03452d 100644 --- a/tests/qemu-iotests/028.out +++ b/tests/qemu-iotests/028.out @@ -469,10 +469,7 @@ No errors were found on the image. block-backup Formatting 'TEST_DIR/t.IMGFMT.copy', fmt=IMGFMT size=4294968832 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT -(qemu) (qemu) iininfinfoinfo info binfo blinfo bloinfo blocinfo blockinfo block-info block-jinfo block-joinfo block-jobinfo block-jobs -Type backup, device disk: Completed 0 of 4294968832 bytes, speed limit 0 bytes/s -iininfinfoinfo info binfo blinfo bloinfo blocinfo blockinfo block-info block-jinfo block-joinfo block-jobinfo block-jobs No active jobs === IO: pattern 195 read 512/512 bytes at offset 3221194240 -- 2.4.3