Commit 23611d7f authored by Mathieu Chartier's avatar Mathieu Chartier
Browse files

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: Id5a532c2a9b3377641523aaed67f1b48a8ec632b

(cherry picked from commit 97afbd79)
parent 2bc5e811
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment