Repository: hbase
Updated Branches:
  refs/heads/master 5bf98d082 -> 2adec36b2


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/2adec36b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2adec36b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2adec36b

Branch: refs/heads/master
Commit: 2adec36b2f57fea7006036e5a1f4d5979737ab34
Parents: 5bf98d0
Author: Devaraj Das <d...@apache.org>
Authored: Wed Mar 11 13:55:01 2015 -0700
Committer: Devaraj Das <d...@apache.org>
Committed: Wed Mar 11 13:55:01 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/2adec36b/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 26290d6..61d5ba9 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
@@ -1750,7 +1750,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()
@@ -1760,9 +1761,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.");
     }
   }
 
@@ -1774,7 +1775,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);
   }
 

Reply via email to