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

In TestFairScheduler, testcase should not create FairScheduler redundantly

    Details

    • Type: Test
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.9.0, 3.0.0-alpha2
    • Component/s: fairscheduler
    • Labels:
      None
    • Hadoop Flags:
      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.001.patch
          2 kB
          Tao Jie
        2. YARN-4363.0002.patch
          2 kB
          Rohith Sharma K S

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: