You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ps...@apache.org on 2018/12/01 09:01:46 UTC

hbase git commit: HBASE-21479 Individual tests in TestHRegionReplayEvents class are failing

Repository: hbase
Updated Branches:
  refs/heads/master 766aa1bfc -> 5c209f2ce


HBASE-21479 Individual tests in TestHRegionReplayEvents class are failing

Signed-off-by: Michael Stack <st...@apache.org>


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

Branch: refs/heads/master
Commit: 5c209f2cec19d179702f104f6758c3bcb1512eb6
Parents: 766aa1b
Author: Peter Somogyi <ps...@apache.org>
Authored: Fri Nov 30 16:39:36 2018 +0100
Committer: Peter Somogyi <ps...@apache.org>
Committed: Sat Dec 1 09:36:10 2018 +0100

----------------------------------------------------------------------
 .../regionserver/TestHRegionReplayEvents.java   | 32 +++++++++++++-------
 1 file changed, 21 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5c209f2c/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java
index 308dc03..3b3b8c3 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java
@@ -66,7 +66,7 @@ import org.apache.hadoop.hbase.io.hfile.HFileContext;
 import org.apache.hadoop.hbase.regionserver.HRegion.FlushResultImpl;
 import org.apache.hadoop.hbase.regionserver.HRegion.PrepareFlushResult;
 import org.apache.hadoop.hbase.regionserver.throttle.NoLimitThroughputController;
-import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.testclassification.LargeTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManagerTestHelper;
@@ -80,7 +80,9 @@ import org.apache.hadoop.hbase.wal.WALKeyImpl;
 import org.apache.hadoop.hbase.wal.WALSplitter.MutationReplay;
 import org.apache.hadoop.util.StringUtils;
 import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
@@ -108,7 +110,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.StoreDescript
  * Tests of HRegion methods for replaying flush, compaction, region open, etc events for secondary
  * region replicas
  */
-@Category(MediumTests.class)
+@Category(LargeTests.class)
 public class TestHRegionReplayEvents {
 
   @ClassRule
@@ -120,7 +122,7 @@ public class TestHRegionReplayEvents {
 
   private static HBaseTestingUtility TEST_UTIL;
 
-  public static Configuration CONF ;
+  public static Configuration CONF;
   private String dir;
 
   private byte[][] families = new byte[][] {
@@ -136,17 +138,27 @@ public class TestHRegionReplayEvents {
   // per test fields
   private Path rootDir;
   private TableDescriptor htd;
-  private long time;
   private RegionServerServices rss;
   private RegionInfo primaryHri, secondaryHri;
   private HRegion primaryRegion, secondaryRegion;
-  private WALFactory wals;
   private WAL walPrimary, walSecondary;
   private WAL.Reader reader;
 
+  @BeforeClass
+  public static void setUpBeforeClass() throws Exception {
+    TEST_UTIL = new HBaseTestingUtility();
+    TEST_UTIL.startMiniDFSCluster(1);
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() throws Exception {
+    LOG.info("Cleaning test directory: " + TEST_UTIL.getDataTestDir());
+    TEST_UTIL.cleanupTestDir();
+    TEST_UTIL.shutdownMiniDFSCluster();
+  }
+
   @Before
-  public void setup() throws IOException {
-    TEST_UTIL = HBaseTestingUtility.createLocalHTU();
+  public void setUp() throws Exception {
     CONF = TEST_UTIL.getConfiguration();
     dir = TEST_UTIL.getDataTestDir("TestHRegionReplayEvents").toString();
     method = name.getMethodName();
@@ -160,14 +172,14 @@ public class TestHRegionReplayEvents {
     }
     htd = builder.build();
 
-    time = System.currentTimeMillis();
+    long time = System.currentTimeMillis();
     ChunkCreator.initialize(MemStoreLABImpl.CHUNK_SIZE_DEFAULT, false, 0, 0, 0, null);
     primaryHri =
         RegionInfoBuilder.newBuilder(htd.getTableName()).setRegionId(time).setReplicaId(0).build();
     secondaryHri =
         RegionInfoBuilder.newBuilder(htd.getTableName()).setRegionId(time).setReplicaId(1).build();
 
-    wals = TestHRegion.createWALFactory(CONF, rootDir);
+    WALFactory wals = TestHRegion.createWALFactory(CONF, rootDir);
     walPrimary = wals.getWAL(primaryHri);
     walSecondary = wals.getWAL(secondaryHri);
 
@@ -207,8 +219,6 @@ public class TestHRegionReplayEvents {
     }
 
     EnvironmentEdgeManagerTestHelper.reset();
-    LOG.info("Cleaning test directory: " + TEST_UTIL.getDataTestDir());
-    TEST_UTIL.cleanupTestDir();
   }
 
   String getName() {