freebsd-src/contrib/netbsd-tests/lib
Alex Richardson 371f152c7f Significantly speed up libthr/mutex_test and make more reliable
Instead of using a simple global++ as the data race, with this change we
perform the increment by loading the global, delaying for a bit and then
storing back the incremented value. If I move the increment outside of the
mutex protected range, I can now see the data race with only 100 iterations
on amd64 in almost all cases. Before this change such a racy test almost
always passed with < 100,000 iterations and only reliably failed with the
current limit of 10 million.

I noticed this poorly written test because the mutex:mutex{2,3} and
timedmutex:mutex{2,3} tests were always timing out on our CheriBSD Jenkins.
Writing good concurrency tests is hard so I won't attempt to do so, but this
change should make the test more likely to fail if pthread_mutex_lock is not
implemented correctly while also significantly reducing the time it takes to
run these four tests. It will also reduce the time it takes for QEMU RISC-V
testsuite runs by almost 40 minutes (out of currently 7 hours).

Reviewed By:	brooks, ngie
Differential Revision: https://reviews.freebsd.org/D26473
2020-11-26 13:31:57 +00:00
..
csu
libbluetooth
libbpfjit
libc [tests] Fix itimer test warning-errors on gcc-6.4 2020-10-15 14:55:07 +00:00
libcrypt
libcurses
libdes
libevent
libexecinfo MFV r365599: import fix for a libexecinfo warning at higher WARNS 2020-09-10 17:48:27 +00:00
libm Amend r343442, by only expecting the lib.msun.cbrt_test.cbrtl_powl and 2019-02-08 18:31:54 +00:00
libobjc
libposix
libppath
libprop
libpthread Significantly speed up libthr/mutex_test and make more reliable 2020-11-26 13:31:57 +00:00
libpthread_dbg
librefuse
librt librt: tests: fix minor issues with higher WARNS 2020-09-10 17:53:00 +00:00
librumpclient
librumphijack
libskey
libsljit
libusbhid
libutil
semaphore