Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-4363

In TestFairScheduler, testcase should not create FairScheduler redundantly

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 2.6.0
    • 2.9.0, 3.0.0-alpha2
    • fairscheduler
    • 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.

      Attachments

        1. YARN-4363.0002.patch
          2 kB
          Rohith Sharma K S
        2. YARN-4363.001.patch
          2 kB
          Tao Jie

        Activity

          People

            Tao Jie Tao Jie
            Tao Jie Tao Jie
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: