Details
Description
In https://issues.apache.org/jira/browse/HDFS-13723, increasing the amount of time in sleep() helps but the problem still appears, which is annoying.
Solution:
Use a loop to allow the test case to fail maxTrials times before declaring failure. Wait 50 ms between each retry.