From commits-return-66748-archive-asf-public=cust-asf.ponee.io@hbase.apache.org Thu Feb 1 00:18:54 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 388BE180662 for ; Thu, 1 Feb 2018 00:18:54 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 28874160C42; Wed, 31 Jan 2018 23:18:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 70499160C55 for ; Thu, 1 Feb 2018 00:18:53 +0100 (CET) Received: (qmail 83932 invoked by uid 500); 31 Jan 2018 23:18:52 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 83922 invoked by uid 99); 31 Jan 2018 23:18:52 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jan 2018 23:18:52 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D940AEEE38; Wed, 31 Jan 2018 23:18:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: stack@apache.org To: commits@hbase.apache.org Date: Wed, 31 Jan 2018 23:18:52 -0000 Message-Id: <41096d6c7d86490ba3a1c5313479ae2a@git.apache.org> In-Reply-To: <82f3b15d17564b838eaa07c443b0ca89@git.apache.org> References: <82f3b15d17564b838eaa07c443b0ca89@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] hbase git commit: HBASE-19907 TestMetaWithReplicas still flakey HBASE-19907 TestMetaWithReplicas still flakey Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/e6d2682f Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/e6d2682f Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/e6d2682f Branch: refs/heads/branch-2 Commit: e6d2682f0f918eecd901b5757e4b3d23a9612c30 Parents: 80af9bd Author: Michael Stack Authored: Wed Jan 31 15:17:38 2018 -0800 Committer: Michael Stack Committed: Wed Jan 31 15:18:45 2018 -0800 ---------------------------------------------------------------------- .../hadoop/hbase/client/TestMetaWithReplicas.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/e6d2682f/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java index 4f38fbe..a87bd7c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.client; import static org.apache.hadoop.hbase.util.hbck.HbckTestingUtil.assertErrors; import static org.apache.hadoop.hbase.util.hbck.HbckTestingUtil.doFsck; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -113,11 +114,20 @@ public class TestMetaWithReplicas { // Fun. All meta region replicas have ended up on the one server. This will cause this test // to fail ... sometimes. if (sns.size() == 1) { + int count = TEST_UTIL.getMiniHBaseCluster().getLiveRegionServerThreads().size(); + assertTrue("count=" + count, count == REGIONSERVERS_COUNT); LOG.warn("All hbase:meta replicas are on the one server; moving hbase:meta"); int metaServerIndex = TEST_UTIL.getHBaseCluster().getServerWithMeta(); - int newServerIndex = (metaServerIndex + 1) % REGIONSERVERS_COUNT; + int newServerIndex = metaServerIndex; + while (newServerIndex == metaServerIndex) { + newServerIndex = (newServerIndex + 1) % REGIONSERVERS_COUNT; + } + assertNotEquals(metaServerIndex, newServerIndex); ServerName destinationServerName = TEST_UTIL.getHBaseCluster().getRegionServer(newServerIndex).getServerName(); + ServerName metaServerName = + TEST_UTIL.getHBaseCluster().getRegionServer(metaServerIndex).getServerName(); + assertNotEquals(destinationServerName, metaServerName); TEST_UTIL.getAdmin().move(RegionInfoBuilder.FIRST_META_REGIONINFO.getEncodedNameAsBytes(), Bytes.toBytes(destinationServerName.toString())); }