hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject svn commit: r1449101 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
Date Fri, 22 Feb 2013 16:24:37 GMT
Author: ramkrishna
Date: Fri Feb 22 16:24:36 2013
New Revision: 1449101

URL: http://svn.apache.org/r1449101
Log:
HBASE-7866 - TestSplitTransactionOnCluster.testSplitBeforeSettingSplittingInZK failed 3 times
in a row (Ram)


Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java?rev=1449101&r1=1449100&r2=1449101&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
Fri Feb 22 16:24:36 2013
@@ -743,15 +743,31 @@ public class TestSplitTransactionOnClust
           @Override
           int createNodeSplitting(ZooKeeperWatcher zkw, HRegionInfo region, ServerName serverName)
               throws KeeperException, IOException {
-            throw new IOException();
+            throw new SplittingNodeCreationFailedException ();
           }
         };
       }
+      String node = ZKAssign.getNodeName(regionServer.getZooKeeper(), regions.get(0)
+          .getRegionInfo().getEncodedName());
+      regionServer.getZooKeeper().sync(node);
+      for (int i = 0; i < 100; i++) {
+        // We expect the znode to be deleted by this time. Here the
+        // znode could be in OPENED state and the
+        // master has not yet deleted the znode.
+        if (ZKUtil.checkExists(regionServer.getZooKeeper(), node) != -1) {
+          Thread.sleep(100);
+        }
+      }
       try {
         st.execute(regionServer, regionServer);
       } catch (IOException e) {
-        String node = ZKAssign.getNodeName(regionServer.getZooKeeper(), regions.get(0)
-            .getRegionInfo().getEncodedName());
+        // check for the specific instance in case the Split failed due to the
+        // existence of the znode in OPENED state.
+        // This will at least make the test to fail;
+        assertTrue("Should be instance of CreateSplittingNodeFailedException",
+            e instanceof SplittingNodeCreationFailedException );
+        node = ZKAssign.getNodeName(regionServer.getZooKeeper(), regions.get(0).getRegionInfo()
+            .getEncodedName());
         {
           assertTrue(ZKUtil.checkExists(regionServer.getZooKeeper(), node) == -1);
         }
@@ -979,5 +995,11 @@ public class TestSplitTransactionOnClust
     }
   }
 
+  private static class SplittingNodeCreationFailedException  extends IOException {
+    public SplittingNodeCreationFailedException () {
+      super();
+    }
+  }
+
 }
 



Mime
View raw message