From owner-freebsd-hackers@freebsd.org Tue Apr 25 23:02:50 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 101A0D50738 for ; Tue, 25 Apr 2017 23:02:50 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E57511D82; Tue, 25 Apr 2017 23:02:49 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id E95FF5A9F15; Tue, 25 Apr 2017 23:02:47 +0000 (UTC) Date: Tue, 25 Apr 2017 23:02:47 +0000 From: Brooks Davis To: freebsd-hackers@freebsd.org Cc: asomers@freebsd.org, ngie@freebsd.org Subject: racy tests Message-ID: <20170425230247.GA8201@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Apr 2017 23:02:50 -0000 --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I've been running the FreeBSD test suite for mips64 under qemu. As a result, I'm seeing some tests fail due to assumptions about timing producing test races. For example one of the pwait tests does this: timeout_many_body() { sleep 1 & =20 p1=3D$! sleep 5 & p5=3D$! sleep 10 &=20 p10=3D$! atf_check \ -o empty \ -e empty \ -s exit:124 \ timeout --preserve-status 7.5 pwait -t 6 $p1 $p5 $p10 } Under emulation, particularly if the host disks are busy, it's easily possible for the first sleep to exit before pwait actually runs. In practice, we could probably get away with cranking up the times a fair bit, but that would make the test slow and the race would still exist. Any thoughts about the right solution? Something not time based would be ideal, but then it seems like we'd need a parallel process to kill some of the waited for victims we quickly end up with something more complicated than pwait that also needs testing... -- Brooks --NzB8fVQJ5HfG6fxh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJY/9WXAAoJEKzQXbSebgfACPQIAInKbBBIC3kzkZc9Wi6A8kza UQYBlbR0CB4t3if3I+j97XBoNO+lQk9IfazSHCMmEeGJggj1UMSJh+H7p/NsyPoY ektl18buLHti9i8j+YadSRoNgNzWXZCLr+0gp6l2irAoRwHvssFCm+EB6ANWGuWX UnFX2ZolXrvFc4y3YKd1+P35/gIXUGxWRXWK9893+PyFU2XHUig/mIiui1klifIU kRQQVnxmOW0tyCVw7vmfRz9/0B0DpHcyZQwPpMVhZS/A88FQdk0X3RXyZM2XjWjM g3MsmFFoKaZsefKIqF10fPSf5N/pejFMLnL8Jm/aD3/bjh3fU5Re/5XXwHiAbhY= =LyF5 -----END PGP SIGNATURE----- --NzB8fVQJ5HfG6fxh--