From d6d67d1e9f61bb231130a9cd453d86594841da9c Mon Sep 17 00:00:00 2001 From: robin7roy <57340134+robin7roy@users.noreply.github.com> Date: Wed, 3 Feb 2021 10:34:34 +0530 Subject: [PATCH] HBASE-25546 PerfTestCompactionPolicies is failing because of NPE (#2921) Adds mock for getRegionInfo which was missing earlier. Signed-off-by: Pankaj Kumar --- .../regionserver/compactions/PerfTestCompactionPolicies.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/PerfTestCompactionPolicies.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/PerfTestCompactionPolicies.java index 13c7a6bc103..0c84507c956 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/PerfTestCompactionPolicies.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/PerfTestCompactionPolicies.java @@ -29,6 +29,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.client.RegionInfoBuilder; import org.apache.hadoop.hbase.regionserver.HStore; import org.apache.hadoop.hbase.regionserver.HStoreFile; import org.apache.hadoop.hbase.regionserver.StoreConfigInformation; @@ -197,6 +198,7 @@ public class PerfTestCompactionPolicies extends MockStoreFileGenerator { HStore s = mock(HStore.class); when(s.getStoreFileTtl()).thenReturn(Long.MAX_VALUE); when(s.getBlockingFileCount()).thenReturn(7L); + when(s.getRegionInfo()).thenReturn(RegionInfoBuilder.FIRST_META_REGIONINFO); return s; }