Line 89 of
java/util/concurrent/locks/Lock/FlakyMutex.java
reads
check(es.awaitTermination(10, TimeUnit.SECONDS));
It turns out that on very slow machines with fastdebug builds this timeout is insufficient.
For instance, vm-v100-01.sfbay is a single CPU 650 MHz sparc. If I compile the test standalone and run it, I get this:
sd208054@vm-v100-01:~ $ /java/re/jdk/7/promoted/all/b32/binaries/solaris-sparcv9/fastdebug/bin/java -d64 FlakyMutex
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1310)
at FlakyMutex.fail(FlakyMutex.java:138)
at FlakyMutex.check(FlakyMutex.java:141)
at FlakyMutex.realMain(FlakyMutex.java:89)
at FlakyMutex.main(FlakyMutex.java:146)
Passed = 75464, failed = 1
Exception in thread "main" java.lang.AssertionError: Some tests failed
at FlakyMutex.main(FlakyMutex.java:148)
Doubling the timeout fixes the issue, at least for a machine this slow.