From commits-return-84668-apmail-hbase-commits-archive=hbase.apache.org@hbase.apache.org Sun Apr 7 13:03:12 2019 Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 79A73188E7 for ; Sun, 7 Apr 2019 13:03:12 +0000 (UTC) Received: (qmail 4707 invoked by uid 500); 7 Apr 2019 12:43:34 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 4679 invoked by uid 500); 7 Apr 2019 12:43:34 -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 4668 invoked by uid 99); 7 Apr 2019 12:43:34 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Apr 2019 12:43:34 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 72D8D8093A; Sun, 7 Apr 2019 13:03:11 +0000 (UTC) Date: Sun, 07 Apr 2019 13:03:11 +0000 To: "commits@hbase.apache.org" Subject: [hbase] branch branch-2.1 updated: HBASE-22180 Make TestBlockEvictionFromClient.testBlockRefCountAfterSplits more stable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <155464219136.25559.14113464725037266361@gitbox.apache.org> From: zhangduo@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: hbase X-Git-Refname: refs/heads/branch-2.1 X-Git-Reftype: branch X-Git-Oldrev: 08060b32b10dfa1f7c51a9dab59b54a5f8e255ce X-Git-Newrev: 11e84f9c6848bd13fcb28ef6955de91ea062f30d X-Git-Rev: 11e84f9c6848bd13fcb28ef6955de91ea062f30d X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/branch-2.1 by this push: new 11e84f9 HBASE-22180 Make TestBlockEvictionFromClient.testBlockRefCountAfterSplits more stable 11e84f9 is described below commit 11e84f9c6848bd13fcb28ef6955de91ea062f30d Author: zhangduo AuthorDate: Sat Apr 6 22:23:41 2019 +0800 HBASE-22180 Make TestBlockEvictionFromClient.testBlockRefCountAfterSplits more stable --- .../hbase/client/TestBlockEvictionFromClient.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java index fc4c1f9..f129f8f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java @@ -23,7 +23,6 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import java.util.ArrayList; -import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Optional; @@ -72,6 +71,8 @@ import org.junit.rules.TestName; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.apache.hbase.thirdparty.com.google.common.collect.Iterables; + @Category({ LargeTests.class, ClientTests.class }) @SuppressWarnings("deprecation") public class TestBlockEvictionFromClient { @@ -577,7 +578,7 @@ public class TestBlockEvictionFromClient { table = TEST_UTIL.createTable(tableName, FAMILIES_1, 1, 1024); // get the block cache and region RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(tableName); - String regionName = locator.getAllRegionLocations().get(0).getRegionInfo().getEncodedName(); + String regionName = locator.getAllRegionLocations().get(0).getRegion().getEncodedName(); HRegion region = TEST_UTIL.getRSForFirstRegionInTable(tableName).getRegion(regionName); HStore store = region.getStores().iterator().next(); @@ -601,19 +602,12 @@ public class TestBlockEvictionFromClient { put.addColumn(FAMILY, QUALIFIER2, data2); table.put(put); region.flush(true); + ServerName rs = Iterables.getOnlyElement(TEST_UTIL.getAdmin().getRegionServers()); + int regionCount = TEST_UTIL.getAdmin().getRegions(rs).size(); LOG.info("About to SPLIT on " + Bytes.toString(ROW1)); TEST_UTIL.getAdmin().split(tableName, ROW1); // Wait for splits - Collection regionServers = TEST_UTIL.getAdmin().getRegionServers(); - Iterator serverItr = regionServers.iterator(); - serverItr.hasNext(); - ServerName rs = serverItr.next(); - List onlineRegions = TEST_UTIL.getAdmin().getRegions(rs); - while (onlineRegions.size() != 2) { - onlineRegions = TEST_UTIL.getAdmin().getRegions(rs); - Thread.sleep(100); - LOG.info("Waiting on SPLIT to complete..."); - } + TEST_UTIL.waitFor(60000, () -> TEST_UTIL.getAdmin().getRegions(rs).size() > regionCount); region.compact(true); Iterator iterator = cache.iterator(); // Though the split had created the HalfStorefileReader - the firstkey and lastkey scanners