commit | 97afbd7972a43345ea12eb442b2a4e473b03d881 | [log] [tgz] |
---|---|---|
author | Mathieu Chartier <mathieuc@google.com> | Mon Jun 23 10:09:06 2014 -0700 |
committer | Mathieu Chartier <mathieuc@google.com> | Mon Jun 23 10:40:53 2014 -0700 |
tree | efa5aa6a9bae593e5733a96a032857fcf6bb16e7 | |
parent | cb8217586ab2f6d88d75a563cbfb7cd57e746bd3 [diff] |
Fix race condition in WeakHashMapTest. There was a race condition where the reference queue daemon wouldn't necessarily have processed the cleared references by the time we called WeakHashMap.size(). The race is fixed by doing a busy wait with a 5 second timeout. This should't increase the test time in the average case since the cleared weak references should be processed shortly after induceFinalization finishes. Bug: 15775475 Change-Id: I66350b6c87252e98bfbd945fe1f96bef58ec24a9