Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-21076

TestTableResource fails with NPE

    XMLWordPrintableJSON

Details

    Description

      The following can be observed in master branch:

      java.lang.NullPointerException
      	at org.apache.hadoop.hbase.rest.TestTableResource.setUpBeforeClass(TestTableResource.java:134)
      

      The NPE comes from the following in TestEndToEndSplitTransaction :

              compactAndBlockUntilDone(TEST_UTIL.getAdmin(),
                TEST_UTIL.getMiniHBaseCluster().getRegionServer(0), daughterA.getRegionName());
      

      Initial check of the code shows that TestEndToEndSplitTransaction uses TEST_UTIL instance which is created within TestEndToEndSplitTransaction. However, TestTableResource creates its own instance of HBaseTestingUtility.
      Meaning TEST_UTIL.getMiniHBaseCluster() would return null, since the instance created by TestEndToEndSplitTransaction has hbaseCluster as null.

      Attachments

        1. HBASE-21076.0.patch
          5 kB
          Sean Busbey
        2. HBASE-21076.1.patch
          7 kB
          Sean Busbey

        Issue Links

          Activity

            People

              busbey Sean Busbey
              yuzhihong@gmail.com Ted Yu
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: