From patchwork Tue Jan 19 16:16:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 8064051 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5B901BEEE5 for ; Tue, 19 Jan 2016 16:29:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98C8720172 for ; Tue, 19 Jan 2016 16:29:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF8E520265 for ; Tue, 19 Jan 2016 16:29:46 +0000 (UTC) Received: from localhost ([::1]:37955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLZAA-00057F-7P for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Jan 2016 11:29:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLYxb-0006mA-Go for qemu-devel@nongnu.org; Tue, 19 Jan 2016 11:16:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLYxX-0004GA-Ce for qemu-devel@nongnu.org; Tue, 19 Jan 2016 11:16:47 -0500 Received: from resqmta-po-06v.sys.comcast.net ([2001:558:fe16:19:96:114:154:165]:50272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLYxX-0004G1-72 for qemu-devel@nongnu.org; Tue, 19 Jan 2016 11:16:43 -0500 Received: from resomta-po-14v.sys.comcast.net ([96.114.154.238]) by resqmta-po-06v.sys.comcast.net with comcast id 7sGa1s00758ss0Y01sGhWR; Tue, 19 Jan 2016 16:16:41 +0000 Received: from red.redhat.com ([24.10.254.122]) by resomta-po-14v.sys.comcast.net with comcast id 7sGd1s0082fD5rL01sGhcu; Tue, 19 Jan 2016 16:16:41 +0000 From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 19 Jan 2016 09:16:28 -0700 Message-Id: <1453220188-9256-1-git-send-email-eblake@redhat.com> X-Mailer: git-send-email 2.5.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1453220201; bh=eQ2G6HGJ68WV4w5OVNEgmqY/y2U8srEnhK0aW4/LxqM=; h=Received:Received:From:To:Subject:Date:Message-Id; b=irnzavAne86vyd0/LFOGsvYVMTOoachI6mRG1FAwS/49QbYDz/Dlepi1m+mM9rF0N QDAcXBrVUUc7C4AWVTjZMSD8Hv6iUFhofdmRSilAS1vGNtoIZimUj9F7ZrFx4yWEZE xDUjHi7aIdqkq8T6fsv56sxf3MYDVPqpGpibk3COhS0XVvih5mbxxThpH3sGEJE38h pxfRPwVb7VXdjZqRDt9VIxVdzijk8yDDW47pSx/Chn2P0v8yfZOSLqfC8mGl5dXuaz ku21fu5eSSSxZYZL4kWP64srZl2V0h0N9Q9i09W0144vXQUe2zWk1UtUy8MDpCYU9P ukiNkIubTpzaA== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:558:fe16:19:96:114:154:165 Cc: Kevin Wolf , "open list:Block layer core" Subject: [Qemu-devel] [PATCH] qemu-iotests: Reduce racy output in 028 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- v2: add R-b --- 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 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 diff --git a/tests/qemu-iotests/028.out b/tests/qemu-iotests/028.out index 279029d..acd2870 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