You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2020/05/07 20:54:34 UTC

[hbase] branch branch-2.3 updated: HBASE-24338 [Flakey Tests] NPE in TestRaceBetweenSCPAndDTP #1669

This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch branch-2.3
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.3 by this push:
     new 93ca079  HBASE-24338 [Flakey Tests] NPE in TestRaceBetweenSCPAndDTP #1669
93ca079 is described below

commit 93ca07971c116b9e3247f963f9a6c6e2ca910bbf
Author: stack <st...@apache.org>
AuthorDate: Thu May 7 13:53:43 2020 -0700

    HBASE-24338 [Flakey Tests] NPE in TestRaceBetweenSCPAndDTP #1669
    
    Signed-off-by: Lijin Bin <bi...@apache.org>
    Signed-off-by: Duo Zhang <zh...@apache.org>
---
 .../hbase/master/assignment/TestRaceBetweenSCPAndDTP.java     | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndDTP.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndDTP.java
index d3054b7..a268af9 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndDTP.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndDTP.java
@@ -43,12 +43,16 @@ import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Testcase for HBASE-23636.
  */
 @Category({ MasterTests.class, MediumTests.class })
 public class TestRaceBetweenSCPAndDTP {
+  private static final Logger LOG = LoggerFactory.getLogger(TestRaceBetweenSCPAndDTP.class);
+
   @ClassRule
   public static final HBaseClassTestRule CLASS_RULE =
     HBaseClassTestRule.forClass(TestRaceBetweenSCPAndDTP.class);
@@ -115,12 +119,15 @@ public class TestRaceBetweenSCPAndDTP {
     RegionInfo region = UTIL.getMiniHBaseCluster().getRegions(NAME).get(0).getRegionInfo();
     AssignmentManager am = UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager();
     ServerName sn = am.getRegionStates().getRegionState(region).getServerName();
+    LOG.info("ServerName={}, region={}", sn, region);
 
     ARRIVE_GET_REGIONS_ON_TABLE = new CountDownLatch(1);
     RESUME_GET_REGIONS_ON_SERVER = new CountDownLatch(1);
-
+    // Assign to local variable because this static gets set to null in above running thread and
+    // so NPE.
+    CountDownLatch cdl = ARRIVE_GET_REGIONS_ON_TABLE;
     UTIL.getAdmin().disableTableAsync(NAME);
-    ARRIVE_GET_REGIONS_ON_TABLE.await();
+    cdl.await();
 
     ProcedureExecutor<?> procExec =
       UTIL.getMiniHBaseCluster().getMaster().getMasterProcedureExecutor();