From 7cfb46432fbdf9b53592be11efc8a7d79d1a9455 Mon Sep 17 00:00:00 2001 From: Vasudevan Date: Mon, 26 Feb 2018 22:07:42 +0530 Subject: [PATCH] HBASE-20036 TestAvoidCellReferencesIntoShippedBlocks timed out (Ram) --- ...tAvoidCellReferencesIntoShippedBlocks.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java index 0e12ad652d5..d22772ab0a3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java @@ -400,23 +400,27 @@ public class TestAvoidCellReferencesIntoShippedBlocks { scanner = table.getScanner(s1); int count = Iterables.size(scanner); assertEquals("Count the rows", 2, count); - iterator = cache.iterator(); - List newCacheList = new ArrayList<>(); - while (iterator.hasNext()) { - CachedBlock next = iterator.next(); - BlockCacheKey cacheKey = new BlockCacheKey(next.getFilename(), next.getOffset()); - newCacheList.add(cacheKey); - } int newBlockRefCount = 0; - for (BlockCacheKey key : cacheList) { - if (newCacheList.contains(key)) { - newBlockRefCount++; + List newCacheList = new ArrayList<>(); + while (true) { + newBlockRefCount = 0; + newCacheList.clear(); + iterator = cache.iterator(); + while (iterator.hasNext()) { + CachedBlock next = iterator.next(); + BlockCacheKey cacheKey = new BlockCacheKey(next.getFilename(), next.getOffset()); + newCacheList.add(cacheKey); + } + for (BlockCacheKey key : cacheList) { + if (newCacheList.contains(key)) { + newBlockRefCount++; + } + } + if (newBlockRefCount == 6) { + break; } } - - assertEquals("old blocks should still be found ", 6, newBlockRefCount); latch.countDown(); - } catch (IOException e) { } }