The unit test TestBalancer failed sometimes.
I looked for the reason. I found two main reasons causing this.
- 1st. The test TestBalancer#testBalancerWithKeytabs executed timeout.
- 2nd. The test TestBalancer#testBalancerWithKeytabs reset the UGI not completely sometimes in the finally block. And this affected the other unit tests threw IOException, like this:
And there were not only one test will be affected by this. We should add a line to do before doing reset UGI operation and can avoid the potenial exception happens.