Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Apr 2017 23:02:47 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        asomers@freebsd.org, ngie@freebsd.org
Subject:   racy tests
Message-ID:  <20170425230247.GA8201@spindle.one-eyed-alien.net>

next in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170425230247.GA8201>