Program: 61045
Project: 61045
Buggy source:
@Test(timeout=60000) public void testAdvancedConfigOverride() throws Exception {
  TEST_UTIL.getConfiguration().setInt("String_Node_Str",3);
  final TableName tableName=TableName.valueOf(name.getMethodName());
  Table hTable=TEST_UTIL.createTable(tableName,FAMILY,10);
  Admin admin=TEST_UTIL.getAdmin();
  ClusterConnection connection=(ClusterConnection)TEST_UTIL.getConnection();
  byte[] row=Bytes.toBytes(random.nextInt());
  performMultiplePutAndFlush((HBaseAdmin)admin,hTable,row,FAMILY,3,100);
  try (RegionLocator locator=TEST_UTIL.getConnection().getRegionLocator(tableName)){
    HRegionLocation loc=locator.getRegionLocation(row,true);
    byte[] regionName=loc.getRegionInfo().getRegionName();
    AdminProtos.AdminService.BlockingInterface server=connection.getAdmin(loc.getServerName());
    assertTrue(ProtobufUtil.getStoreFiles(server,regionName,FAMILY).size() > 1);
    admin.compact(tableName);
    for (int i=0; i < 10 * 1000 / 40; ++i) {
      loc=locator.getRegionLocation(row,true);
      if (!loc.getRegionInfo().isOffline()) {
        regionName=loc.getRegionInfo().getRegionName();
        server=connection.getAdmin(loc.getServerName());
        if (ProtobufUtil.getStoreFiles(server,regionName,FAMILY).size() <= 1) {
          break;
        }
      }
      Thread.sleep(40);
    }
    assertTrue(ProtobufUtil.getStoreFiles(server,regionName,FAMILY).size() <= 1);
    LOG.info("String_Node_Str");
    HTableDescriptor htd=new HTableDescriptor(hTable.getTableDescriptor());
    htd.setValue("String_Node_Str",String.valueOf(5));
    admin.modifyTable(tableName,htd);
    Pair<Integer,Integer> st;
    while (null != (st=admin.getAlterStatus(tableName)) && st.getFirst() > 0) {
      LOG.debug(st.getFirst() + "String_Node_Str");
      Thread.sleep(40);
    }
    LOG.info("String_Node_Str");
    performMultiplePutAndFlush((HBaseAdmin)admin,hTable,row,FAMILY,3,10);
    admin.compact(tableName);
    Thread.sleep(10 * 1000);
    loc=locator.getRegionLocation(row,true);
    regionName=loc.getRegionInfo().getRegionName();
    server=connection.getAdmin(loc.getServerName());
    int sfCount=ProtobufUtil.getStoreFiles(server,regionName,FAMILY).size();
    assertTrue(sfCount > 1);
    LOG.info("String_Node_Str");
    HColumnDescriptor hcd=new HColumnDescriptor(htd.getFamily(FAMILY));
    hcd.setValue("String_Node_Str",String.valueOf(2));
    htd.modifyFamily(hcd);
    admin.modifyTable(tableName,htd);
    while (null != (st=admin.getAlterStatus(tableName)) && st.getFirst() > 0) {
      LOG.debug(st.getFirst() + "String_Node_Str");
      Thread.sleep(40);
    }
    LOG.info("String_Node_Str");
    admin.compact(tableName);
    for (int i=0; i < 10 * 1000 / 40; ++i) {
      loc=locator.getRegionLocation(row,true);
      regionName=loc.getRegionInfo().getRegionName();
      try {
        server=connection.getAdmin(loc.getServerName());
        if (ProtobufUtil.getStoreFiles(server,regionName,FAMILY).size() < sfCount) {
          break;
        }
      }
 catch (      Exception e) {
        LOG.debug("String_Node_Str" + regionName);
      }
      Thread.sleep(40);
    }
    assertTrue(ProtobufUtil.getStoreFiles(server,regionName,FAMILY).size() < sfCount);
    LOG.info("String_Node_Str");
    LOG.info("String_Node_Str");
    hcd=new HColumnDescriptor(htd.getFamily(FAMILY));
    hcd.setValue("String_Node_Str",null);
    htd.modifyFamily(hcd);
    admin.modifyTable(tableName,htd);
    while (null != (st=admin.getAlterStatus(tableName)) && st.getFirst() > 0) {
      LOG.debug(st.getFirst() + "String_Node_Str");
      Thread.sleep(40);
    }
    LOG.info("String_Node_Str");
    assertNull(hTable.getTableDescriptor().getFamily(FAMILY).getValue("String_Node_Str"));
  }
 }

Fixed version (ground truth):
@Test(timeout=60000) public void testAdvancedConfigOverride() throws Exception {
  TEST_UTIL.getConfiguration().setInt("String_Node_Str",3);
  final TableName tableName=TableName.valueOf(name.getMethodName());
  Table hTable=TEST_UTIL.createTable(tableName,FAMILY,10);
  Admin admin=TEST_UTIL.getAdmin();
  ClusterConnection connection=(ClusterConnection)TEST_UTIL.getConnection();
  byte[] row=Bytes.toBytes(random.nextInt());
  performMultiplePutAndFlush((HBaseAdmin)admin,hTable,row,FAMILY,3,100);
  try (RegionLocator locator=TEST_UTIL.getConnection().getRegionLocator(tableName)){
    HRegionLocation loc=locator.getRegionLocation(row,true);
    byte[] regionName=loc.getRegionInfo().getRegionName();
    AdminProtos.AdminService.BlockingInterface server=connection.getAdmin(loc.getServerName());
    assertTrue(ProtobufUtil.getStoreFiles(server,regionName,FAMILY).size() > 1);
    admin.compact(tableName);
    for (int i=0; i < 10 * 1000 / 40; ++i) {
      loc=locator.getRegionLocation(row,true);
      if (!loc.getRegionInfo().isOffline()) {
        regionName=loc.getRegionInfo().getRegionName();
        server=connection.getAdmin(loc.getServerName());
        if (ProtobufUtil.getStoreFiles(server,regionName,FAMILY).size() <= 1) {
          break;
        }
      }
      Thread.sleep(40);
    }
    assertTrue(ProtobufUtil.getStoreFiles(server,regionName,FAMILY).size() <= 1);
    LOG.info("String_Node_Str");
    HTableDescriptor htd=new HTableDescriptor(hTable.getTableDescriptor());
    htd.setValue("String_Node_Str",String.valueOf(5));
    admin.modifyTable(tableName,htd);
    Pair<Integer,Integer> st;
    while (null != (st=admin.getAlterStatus(tableName)) && st.getFirst() > 0) {
      LOG.debug(st.getFirst() + "String_Node_Str");
      Thread.sleep(40);
    }
    LOG.info("String_Node_Str");
    performMultiplePutAndFlush((HBaseAdmin)admin,hTable,row,FAMILY,3,10);
    admin.compact(tableName);
    Thread.sleep(10 * 1000);
    loc=locator.getRegionLocation(row,true);
    regionName=loc.getRegionInfo().getRegionName();
    server=connection.getAdmin(loc.getServerName());
    int sfCount=ProtobufUtil.getStoreFiles(server,regionName,FAMILY).size();
    assertTrue(sfCount > 1);
    LOG.info("String_Node_Str");
    HColumnDescriptor hcd=new HColumnDescriptor(htd.getFamily(FAMILY));
    hcd.setValue("String_Node_Str",String.valueOf(2));
    htd.modifyFamily(hcd);
    admin.modifyTable(tableName,htd);
    while (null != (st=admin.getAlterStatus(tableName)) && st.getFirst() > 0) {
      LOG.debug(st.getFirst() + "String_Node_Str");
      Thread.sleep(40);
    }
    LOG.info("String_Node_Str");
    admin.compact(tableName);
    for (int i=0; i < 10 * 1000 / 40; ++i) {
      loc=locator.getRegionLocation(row,true);
      regionName=loc.getRegionInfo().getRegionName();
      try {
        server=connection.getAdmin(loc.getServerName());
        if (ProtobufUtil.getStoreFiles(server,regionName,FAMILY).size() < sfCount) {
          break;
        }
      }
 catch (      Exception e) {
        LOG.debug("String_Node_Str" + Bytes.toString(regionName));
      }
      Thread.sleep(40);
    }
    assertTrue(ProtobufUtil.getStoreFiles(server,regionName,FAMILY).size() < sfCount);
    LOG.info("String_Node_Str");
    LOG.info("String_Node_Str");
    hcd=new HColumnDescriptor(htd.getFamily(FAMILY));
    hcd.setValue("String_Node_Str",null);
    htd.modifyFamily(hcd);
    admin.modifyTable(tableName,htd);
    while (null != (st=admin.getAlterStatus(tableName)) && st.getFirst() > 0) {
      LOG.debug(st.getFirst() + "String_Node_Str");
      Thread.sleep(40);
    }
    LOG.info("String_Node_Str");
    assertNull(hTable.getTableDescriptor().getFamily(FAMILY).getValue("String_Node_Str"));
  }
 }