freebsd-dev/contrib/netbsd-tests
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
..
bin Add testcases for cat -b 2017-06-06 21:50:00 +00:00
crypto Upgrade NetBSD tests to 01.11.2017_23.20 snapshot 2017-01-13 03:33:57 +00:00
dev Merge in changes from ^/vendor/NetBSD/tests/dist@r313245 2017-02-04 18:20:07 +00:00
fs tmpfs tests: check for built-in tmpfs module 2020-10-02 00:52:31 +00:00
games Restore pathing for factor(1), which unnecessarily diverged in r278616 2016-12-03 03:13:32 +00:00
include Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
ipf Checkpoint initial integration work 2016-08-12 08:50:05 +00:00
kernel Temporarily skip flakey sys.kern.sysv_test.msg in CI 2020-06-26 17:58:10 +00:00
lib Significantly speed up libthr/mutex_test and make more reliable 2020-11-26 13:31:57 +00:00
libexec/ld.elf_so Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
modules Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
net Merge in changes from ^/vendor/NetBSD/tests/dist@r313245 2017-02-04 18:20:07 +00:00
rump Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
sbin Checkpoint initial integration work 2016-08-12 08:50:05 +00:00
share Checkpoint initial integration work 2016-08-12 08:50:05 +00:00
sys Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
usr.bin zgrep: fix exit status with multiple files 2020-10-01 21:48:22 +00:00
usr.sbin mtree: Fix -f -f not considering type changes. 2019-09-12 18:44:48 +00:00
FREEBSD-upgrade
h_macros.h Upgrade NetBSD tests to 01.11.2017_23.20 snapshot 2017-01-13 03:33:57 +00:00