Repository: hbase Updated Branches: refs/heads/master 712dad814 -> 8915130dd
HBASE-12212 HBaseTestingUtility#waitUntilAllRegionsAssigned should wait for RegionStates Signed-off-by: stack <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8915130d Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8915130d Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8915130d Branch: refs/heads/master Commit: 8915130dd7f3e497083c9fa9a25c511dd3787082 Parents: 712dad8 Author: stack <[email protected]> Authored: Thu Oct 9 16:12:07 2014 -0700 Committer: stack <[email protected]> Committed: Thu Oct 9 20:34:58 2014 -0700 ---------------------------------------------------------------------- .../org/apache/hadoop/hbase/HBaseTestingUtility.java | 11 +++++++++++ 1 file changed, 11 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/8915130d/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 2382827..bbd9dbe 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 @@ -3045,6 +3045,17 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility { } finally { meta.close(); } + // So, all regions are in the meta table but make sure master knows of the assignments before + // returing -- sometimes this can lag. + HMaster master = getHBaseCluster().getMaster(); + final RegionStates states = master.getAssignmentManager().getRegionStates(); + waitFor(timeout, 200, new Predicate<IOException>() { + @Override + public boolean evaluate() throws IOException { + List<HRegionInfo> hris = states.getRegionsOfTable(tableName); + return hris != null && !hris.isEmpty(); + } + }); } /**
