I am making test for HDFS-11051, I found a serious issue: All the tests in TestBalancer fails except TestBalancer#testBalancerWithKeytabs. I saw there was NPE threw in the method TestBalancer#destroy. The stack infos:
The related codes:
It seems that the deleted dir baseDir is only used in TestBalancer#testBalancerWithKeytabs, but here we don't do a check and then it throws the NPE. Finally cause the other tests fails. Since it will run the test TestBalancer#testBalancerWithKeytabs and initialize the dir if we do the whole test TesrBalancer, and it will runs good. However, it will fails if we want to run a single test in TestBalancer.