hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject hbase git commit: HBASE-13192. IntegrationTestBulkLoad doesn't wait for table modification sometimes leading to spurious test failures.
Date Wed, 11 Mar 2015 20:55:45 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 f8dced1e6 -> e864dd052


HBASE-13192. IntegrationTestBulkLoad doesn't wait for table modification sometimes leading
to spurious test failures.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/e864dd05
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/e864dd05
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/e864dd05

Branch: refs/heads/branch-1
Commit: e864dd0520dd62e95a98b0e9c92891c546aff999
Parents: f8dced1
Author: Devaraj Das <ddas@apache.org>
Authored: Wed Mar 11 13:55:01 2015 -0700
Committer: Devaraj Das <ddas@apache.org>
Committed: Wed Mar 11 13:55:34 2015 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/HBaseTestingUtility.java     | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/e864dd05/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
index 5ff3418..ab4cf6e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
@@ -1732,7 +1732,8 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
       setFirst(0);
       setSecond(0);
     }};
-    for (int i = 0; status.getFirst() != 0 && i < 500; i++) { // wait up to 500
seconds
+    int i = 0;
+    do {
       status = admin.getAlterStatus(desc.getTableName());
       if (status.getSecond() != 0) {
         LOG.debug(status.getSecond() - status.getFirst() + "/" + status.getSecond()
@@ -1742,9 +1743,9 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
         LOG.debug("All regions updated.");
         break;
       }
-    }
-    if (status.getSecond() != 0) {
-      throw new IOException("Failed to update replica count after 500 seconds.");
+    } while (status.getFirst() != 0 && i++ < 500);
+    if (status.getFirst() != 0) {
+      throw new IOException("Failed to update all regions even after 500 seconds.");
     }
   }
 
@@ -1756,7 +1757,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
     admin.disableTable(table);
     HTableDescriptor desc = admin.getTableDescriptor(table);
     desc.setRegionReplication(replicaCount);
-    modifyTableSync(admin, desc);
+    admin.modifyTable(desc.getTableName(), desc);
     admin.enableTable(table);
   }
 


Mime
View raw message