From b49ffdcda4c85fa4f1baa7f5d6ec20e45ff95431 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Wed, 12 Sep 2012 06:24:41 +0000 Subject: [PATCH] HBASE-6648 [0.92 UNIT TESTS] TestMasterObserver.testRegionTransitionOperations fails occasionally git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1383797 13f79535-47bb-0310-9956-ffa450edef68 --- .../hbase/coprocessor/TestMasterObserver.java | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java index 22db8bed9e4..a54c5a1bfa0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java @@ -31,6 +31,8 @@ import java.util.Map; import java.util.NavigableMap; import java.util.concurrent.CountDownLatch; +import junit.framework.Assert; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -972,6 +974,8 @@ public class TestMasterObserver { // move half the open regions from RS 0 to RS 1 HRegionServer rs = cluster.getRegionServer(0); byte[] destRS = Bytes.toBytes(cluster.getRegionServer(1).getServerName().toString()); + //Make sure no regions are in transition now + waitForRITtoBeZero(master); List openRegions = ProtobufUtil.getOnlineRegions(rs); int moveCnt = openRegions.size()/2; for (int i=0; i transRegions = + mgr.getRegionStates().getRegionsInTransition().values(); + for (RegionState state : transRegions) { + mgr.getRegionStates().waitOnRegionToClearRegionsInTransition(state.getRegion()); + } + } + @org.junit.Rule public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu = new org.apache.hadoop.hbase.ResourceCheckerJUnitRule();