Skip to content

Commit

Permalink
HBASE-4406 TestOpenRegionHandler failing after HBASE-4287
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1170792 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
toddlipcon committed Sep 14, 2011
1 parent 46d5826 commit 6375de9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ Release 0.91.0 - Unreleased
HBASE-4340 Hbase can't balance if ServerShutdownHandler encountered
exception (Jinchao Gao)
HBASE-4394 Add support for seeking hints to FilterList
HBASE-4406 TestOpenRegionHandler failing after HBASE-4287 (todd)

IMPROVEMENTS
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@
import org.apache.hadoop.hbase.executor.EventHandler.EventType;
import org.apache.hadoop.hbase.regionserver.HRegion;
import org.apache.hadoop.hbase.regionserver.RegionServerServices;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.zookeeper.ZKAssign;
import org.apache.hadoop.hbase.zookeeper.ZKUtil;
import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.KeeperException.NodeExistsException;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mockito;
Expand All @@ -57,9 +59,9 @@ public class TestOpenRegionHandler {
private final static HBaseTestingUtility HTU = new HBaseTestingUtility();
private static final HTableDescriptor TEST_HTD =
new HTableDescriptor("TestOpenRegionHandler.java");
private static final HRegionInfo TEST_HRI =
new HRegionInfo(TEST_HTD.getName(), HConstants.EMPTY_END_ROW,
HConstants.EMPTY_END_ROW);
private HRegionInfo TEST_HRI;

private int testIndex = 0;

@BeforeClass public static void before() throws Exception {
HTU.startMiniZKCluster();
Expand All @@ -69,6 +71,19 @@ public class TestOpenRegionHandler {
HTU.shutdownMiniZKCluster();
}

/**
* Before each test, use a different HRI, so the different tests
* don't interfere with each other. This allows us to use just
* a single ZK cluster for the whole suite.
*/
@Before
public void setupHRI() {
TEST_HRI = new HRegionInfo(TEST_HTD.getName(),
Bytes.toBytes(testIndex),
Bytes.toBytes(testIndex + 1));
testIndex++;
}

/**
* Test the openregionhandler can deal with its znode being yanked out from
* under it.
Expand Down Expand Up @@ -164,4 +179,4 @@ boolean updateMeta(final HRegion r) {
assertEquals(EventType.RS_ZK_REGION_FAILED_OPEN, data.getEventType());
}

}
}

0 comments on commit 6375de9

Please sign in to comment.