Details
-
Test
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
2.6.0
-
None
-
Reviewed
Description
I am trying to make some improvement on fairscheduler, but get some test failure on TestFairScheduler, due to redundant FairScheduler creation:
In TestFairScheduler, FairScheduler and RM is created, then set RMContext of RM to scheduler.
@Before public void setUp() throws IOException { scheduler = new FairScheduler(); conf = createConfiguration(); resourceManager = new MockRM(conf); scheduler.setRMContext(resourceManager.getRMContext()); }
However in several case, scheduler is renewed, as a result RMcontext in scheduler is null.
@Test public void testMinZeroResourcesSettings() throws IOException { scheduler = new FairScheduler(); YarnConfiguration conf = new YarnConfiguration(); ... scheduler.init(conf);
Then do scheduler.init(conf), I get a NPE(I try to get something from RMContext in scheduler initialization).
So FairScheduler should not be renewed in test block.