freebsd-dev/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 Checkpoint initial integration work 2016-08-12 08:50:05 +00:00
libc [tests] Fix itimer test warning-errors on gcc-6.4 2020-10-15 14:55:07 +00:00
libcrypt Hack test so that it works on FreeBSD. 2015-12-01 21:22:29 +00:00
libcurses Checkpoint initial integration work 2016-08-12 08:50:05 +00:00
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 Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
libppath
libprop
libpthread Significantly speed up libthr/mutex_test and make more reliable 2020-11-26 13:31:57 +00:00
libpthread_dbg Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
librefuse Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
librt librt: tests: fix minor issues with higher WARNS 2020-09-10 17:53:00 +00:00
librumpclient Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
librumphijack Upgrade NetBSD tests to 01.11.2017_23.20 snapshot 2017-01-13 03:33:57 +00:00
libskey
libsljit
libusbhid Upgrade NetBSD tests to 01.11.2017_23.20 snapshot 2017-01-13 03:33:57 +00:00
libutil Checkpoint initial integration work 2016-08-12 08:50:05 +00:00
semaphore Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00