Tao Jie created YARN-4363:

             Summary: In TestFairScheduler, testcase should not create 
FairScheduler redundantly
                 Key: YARN-4363
                 URL: https://issues.apache.org/jira/browse/YARN-4363
             Project: Hadoop YARN
          Issue Type: Test
          Components: fairscheduler
    Affects Versions: 2.6.0
            Reporter: Tao Jie
            Priority: Trivial

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.
  public void setUp() throws IOException {
    scheduler = new FairScheduler();
    conf = createConfiguration();
    resourceManager = new MockRM(conf);
However in several case, scheduler is renewed, as a result RMcontext in 
scheduler is null.
  public void testMinZeroResourcesSettings() throws IOException {  
    scheduler = new FairScheduler();
    YarnConfiguration conf = new YarnConfiguration();
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.

This message was sent by Atlassian JIRA

Reply via email to