HBASE-16058 TestHRegion fails on 1.4 builds
This commit is contained in:
parent
bdb0cc8808
commit
6717f0e388
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue