hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject svn commit: r1512134 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java
Date Fri, 09 Aug 2013 04:13:34 GMT
Author: jxiang
Date: Fri Aug  9 04:13:34 2013
New Revision: 1512134

URL: http://svn.apache.org/r1512134
Log:
HBASE-9161 TestAssignmentManagerOnCluster.testSSHWhenDisablingTableRegionsInOpeningOrPendingOpenState
could hang

Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java?rev=1512134&r1=1512133&r2=1512134&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java
Fri Aug  9 04:13:34 2013
@@ -31,7 +31,6 @@ import java.util.Set;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
@@ -40,6 +39,7 @@ import org.apache.hadoop.hbase.HTableDes
 import org.apache.hadoop.hbase.MediumTests;
 import org.apache.hadoop.hbase.ServerLoad;
 import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.catalog.MetaEditor;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
@@ -54,6 +54,7 @@ import org.apache.hadoop.hbase.regionser
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.zookeeper.ZKAssign;
+import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -483,10 +484,18 @@ public class TestAssignmentManagerOnClus
         }
       }
       am.regionOffline(hri);
-      ZKAssign.createNodeOffline(TEST_UTIL.getHBaseCluster().getMaster().getZooKeeper(),
hri,
-        destServerName);
-      ZKAssign.transitionNodeOpening(TEST_UTIL.getHBaseCluster().getMaster().getZooKeeper(),
hri,
-        destServerName);
+      ZooKeeperWatcher zkw = TEST_UTIL.getHBaseCluster().getMaster().getZooKeeper();
+      ZKAssign.createNodeOffline(zkw, hri, destServerName);
+      ZKAssign.transitionNodeOpening(zkw, hri, destServerName);
+
+      // Wait till the event is processed and the region is in transition
+      long timeoutTime = System.currentTimeMillis() + 20000;
+      while (!am.getRegionStates().isRegionInTransition(hri)) {
+        assertTrue("Failed to process ZK opening event in time",
+          System.currentTimeMillis() < timeoutTime);
+        Thread.sleep(100);
+      }
+
       am.getZKTable().setDisablingTable(table);
       List<HRegionInfo> toAssignRegions = am.processServerShutdown(destServerName);
       assertTrue("Regions to be assigned should be empty.", toAssignRegions.isEmpty());



Mime
View raw message