Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
There are a lot of Thread.sleep() calls in TestMemoryLocks.
For example:
new Thread(l1).start(); Thread.sleep(500); new Thread(l2).start(); Thread.sleep(500);
This solution is very fragile. On a slower build machine, Thread2 might actually start earlier than Thread1, causing test failure.
Eliminate sleeps and use a more stable approach for start/stop coordination (possibly CountDownLatches).