hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject [1/2] hbase git commit: HBASE-16058 TestHRegion fails on 1.4 builds
Date Sat, 18 Jun 2016 02:03:45 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 e721aa1a8 -> 1a989a196
  refs/heads/master bdb0cc880 -> 6717f0e38


HBASE-16058 TestHRegion fails on 1.4 builds


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6717f0e3
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6717f0e3
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6717f0e3

Branch: refs/heads/master
Commit: 6717f0e3883577513fef8c6cb8a2d0f4b4f41433
Parents: bdb0cc8
Author: Enis Soztutar <enis@apache.org>
Authored: Fri Jun 17 18:41:51 2016 -0700
Committer: Enis Soztutar <enis@apache.org>
Committed: Fri Jun 17 18:41:51 2016 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/regionserver/TestHRegion.java    | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/6717f0e3/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
index 93074e1..9aa3a9b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
@@ -130,6 +130,7 @@ import org.apache.hadoop.hbase.test.MetricsAssertHelper;
 import org.apache.hadoop.hbase.testclassification.LargeTests;
 import org.apache.hadoop.hbase.testclassification.VerySlowRegionServerTests;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.ClassSize;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManagerTestHelper;
 import org.apache.hadoop.hbase.util.FSUtils;
@@ -452,8 +453,9 @@ public class TestHRegion {
       fail("Should have failed with IOException");
     } catch (IOException expected) {
     }
-    assertEquals("memstoreSize should be incremented", onePutSize * 2, region.getMemstoreSize());
-    assertEquals("flushable size should be incremented", onePutSize * 2, store.getFlushableSize());
+    long expectedSize = onePutSize * 2 - ClassSize.ARRAY;
+    assertEquals("memstoreSize should be incremented", expectedSize, region.getMemstoreSize());
+    assertEquals("flushable size should be incremented", expectedSize, store.getFlushableSize());
 
     region.setCoprocessorHost(null);
     HBaseTestingUtility.closeRegionAndWAL(region);
@@ -523,13 +525,14 @@ public class TestHRegion {
           p2.add(new KeyValue(row, COLUMN_FAMILY_BYTES, qual2, 2, (byte[])null));
           p2.add(new KeyValue(row, COLUMN_FAMILY_BYTES, qual3, 3, (byte[])null));
           region.put(p2);
-          Assert.assertEquals(sizeOfOnePut * 3, region.getMemstoreSize());
+          long expectedSize = sizeOfOnePut * 3- ClassSize.ARRAY;
+          Assert.assertEquals(expectedSize, region.getMemstoreSize());
           // Do a successful flush.  It will clear the snapshot only.  Thats how flushes
work.
           // If already a snapshot, we clear it else we move the memstore to be snapshot
and flush
           // it
           region.flush(true);
           // Make sure our memory accounting is right.
-          Assert.assertEquals(sizeOfOnePut * 2, region.getMemstoreSize());
+          Assert.assertEquals(sizeOfOnePut * 2 - ClassSize.ARRAY, region.getMemstoreSize());
         } finally {
           HBaseTestingUtility.closeRegionAndWAL(region);
         }


Mime
View raw message