Index: hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java =================================================================== --- hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java (revision 1502397) +++ hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java (working copy) @@ -129,9 +129,30 @@ private HRegionInfo getAndCheckSingleTableRegion(final List regions) { assertEquals(1, regions.size()); - return regions.get(0).getRegionInfo(); + HRegionInfo hri = regions.get(0).getRegionInfo(); + return waitOnRIT(hri); } + /** + * Often region has not yet fully opened. If we try to use it -- do a move for instance -- it + * will fail silently if the region is not yet opened. + * @param hri Region to check if in Regions In Transition... wait until out of transition before + * returning + * @return Passed in hri + */ + private HRegionInfo waitOnRIT(final HRegionInfo hri) { + // Close worked but we are going to open the region elsewhere. Before going on, make sure + // this completes. + while (TESTING_UTIL.getHBaseCluster().getMaster().getAssignmentManager(). + getRegionStates().isRegionInTransition(hri)) { + LOG.info("Waiting on region in transition: " + + TESTING_UTIL.getHBaseCluster().getMaster().getAssignmentManager().getRegionStates(). + getRegionTransitionState(hri)); + Threads.sleep(10); + } + return hri; + } + @Test(timeout = 60000) public void testShouldFailSplitIfZNodeDoesNotExistDueToPrevRollBack() throws Exception { final byte[] tableName = Bytes @@ -226,7 +247,7 @@ throws IOException, InterruptedException, NodeExistsException, KeeperException, DeserializationException, ServiceException { final byte [] tableName = - Bytes.toBytes("ephemeral"); + Bytes.toBytes("testRSSplitEphemeralsDisappearButDaughtersAreOnlinedAfterShutdownHandling"); // Create table then get the single region for our new table. HTable t = createTableAndWait(tableName, HConstants.CATALOG_FAMILY);