From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aA1v3-0002mw-NX for qemu-devel@nongnu.org; Fri, 18 Dec 2015 15:46:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aA1v2-0000IQ-Dy for qemu-devel@nongnu.org; Fri, 18 Dec 2015 15:46:29 -0500 References: <1449804437-30373-1-git-send-email-eblake@redhat.com> <566B770C.8070308@redhat.com> From: Eric Blake Message-ID: <56747099.4000006@redhat.com> Date: Fri, 18 Dec 2015 13:46:17 -0700 MIME-Version: 1.0 In-Reply-To: <566B770C.8070308@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1aLCjcJOQrJADvX4IRFcQSfPwqVGs0Gl3" Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] qemu-iotests: Reduce racy output in 028 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-devel@nongnu.org Cc: Kevin Wolf , "open list:Block layer core" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1aLCjcJOQrJADvX4IRFcQSfPwqVGs0Gl3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/11/2015 06:23 PM, John Snow wrote: >=20 ping >=20 > On 12/10/2015 10:27 PM, Eric Blake wrote: >> 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. >> >=20 > Son of a gun: >=20 > 028 4s ... - output mismatch (see 028.out.bad) > --- /home/bos/jsnow/src/q3mu/tests/qemu-iotests/028.out 2015-10-09 > 13:33:06.823758271 -0400 > +++ 028.out.bad 2015-12-11 20:12:23.688952510 -0500 > @@ -470,7 +470,7 @@ >=20 > Formatting 'TEST_DIR/t.IMGFMT.copy', fmt=3DIMGFMT size=3D4294968832 > backing_file=3DTEST_DIR/t.IMGFMT.base backing_fmt=3DIMGFMT > (qemu) > -(qemu) info block-jobs > +info block-jobs > Type backup, device disk: Completed 0 of 4294968832 bytes, speed limit= > 0 bytes/s > info block-jobs > No active jobs >=20 >=20 > Something must have changed to make it more prone to races, somehow. > Venus... Swamp gas... Now that 2.6 is open, is my approach right, or do we need a more robust solution? >=20 >> 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=3D$QEMU_HANDLE >> QEMU_COMM_TIMEOUT=3D1 >> >> # Silence output since it contains the disk image path and QEMU's rea= dline >> -# character echoing makes it very hard to filter the output >> +# character echoing makes it very hard to filter the output. Plus, th= ere >> +# is no telling how many times the command will repeat before succeed= ing. >> _send_qemu_cmd $h "drive_backup disk ${TEST_IMG}.copy" "(qemu)" >/dev= /null >> _send_qemu_cmd $h "" "Formatting" | _filter_img_create >> -qemu_cmd_repeat=3D20 _send_qemu_cmd $h "info block-jobs" "No active j= obs" >> +qemu_cmd_repeat=3D20 _send_qemu_cmd $h "info block-jobs" "No active j= obs" >/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=3DIMGFMT size=3D4294968832 b= acking_file=3DTEST_DIR/t.IMGFMT.base backing_fmt=3DIMGFMT >> -(qemu) >> (qemu) i=1B[K=1B[Din=1B[K=1B[D=1B[Dinf=1B[K=1B[D=1B[D=1B[Dinfo=1B[K=1B= [D=1B[D=1B[D=1B[Dinfo =1B[K=1B[D=1B[D=1B[D=1B[D=1B[Dinfo b=1B[K=1B[D=1B[D= =1B[D=1B[D=1B[D=1B[Dinfo bl=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dinfo b= lo=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dinfo bloc=1B[K=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dinfo block=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[Dinfo block-=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[D=1B[Dinfo block-j=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[Dinfo block-jo=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dinfo block-job=1B[K=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dinfo block-jobs=1B[K >> -Type backup, device disk: Completed 0 of 4294968832 bytes, speed limi= t 0 bytes/s >> -i=1B[K=1B[Din=1B[K=1B[D=1B[Dinf=1B[K=1B[D=1B[D=1B[Dinfo=1B[K=1B[D=1B[= D=1B[D=1B[Dinfo =1B[K=1B[D=1B[D=1B[D=1B[D=1B[Dinfo b=1B[K=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[Dinfo bl=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dinfo blo=1B[K=1B= [D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dinfo bloc=1B[K=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[Dinfo block=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[Dinfo block-=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[Dinfo block-j=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[Dinfo block-jo=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[Dinfo block-job=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dinfo block-jobs=1B[K >> No active jobs >> =3D=3D=3D IO: pattern 195 >> read 512/512 bytes at offset 3221194240 >> >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --1aLCjcJOQrJADvX4IRFcQSfPwqVGs0Gl3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWdHCZAAoJEKeha0olJ0NqqDIH+QEzA1WmWeihbVTcyq7F8pGj xomehhtMHIbAPC+XgrSg4Rzg9xKgQWt6sQoeaRI7Ttfhz4XP/Aw+aDqSDzdD7FgQ RGm6s+d9dMrdMN8GcziYmfNCEyjtvQeYaRTgdbwKVekuo+iZblhGEWeKrYqZhNdf vTn58R4ry3V0y2JUW+OTwmvKmZdwMY/sqdVI53ziG0eJTBIKkEbBFjtfEn0ramkb 1nbgv9h/e4nuRczKsBGl+KKlulCxDerwPAURtmBQlMFN0r//C615Nag9wf4LjKj6 dJsyvyPCKNffVLHFf318hLnIJ0j/ZC2o5q8CHodK2fyXpC84hGayV1ZoM0yggsk= =TtaU -----END PGP SIGNATURE----- --1aLCjcJOQrJADvX4IRFcQSfPwqVGs0Gl3--