ndimiduk commented on a change in pull request #1141: HBASE-23808 [Flakey Test] TestMasterShutdown#testMasterShutdownBefore… URL: https://github.com/apache/hbase/pull/1141#discussion_r378500802
########## File path: hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java ########## @@ -30,26 +34,38 @@ import org.apache.hadoop.hbase.LocalHBaseCluster; import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.StartMiniClusterOption; -import org.apache.hadoop.hbase.client.Admin; -import org.apache.hadoop.hbase.client.Connection; +import org.apache.hadoop.hbase.Waiter; +import org.apache.hadoop.hbase.client.AsyncConnection; import org.apache.hadoop.hbase.client.ConnectionFactory; import org.apache.hadoop.hbase.testclassification.LargeTests; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread; +import org.apache.hadoop.hbase.zookeeper.ReadOnlyZKClient; +import org.junit.Before; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.apache.hbase.thirdparty.org.apache.commons.collections4.CollectionUtils; @Category({MasterTests.class, LargeTests.class}) public class TestMasterShutdown { + private static final Logger LOG = LoggerFactory.getLogger(TestMasterShutdown.class); @ClassRule public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMasterShutdown.class); - private static final Logger LOG = LoggerFactory.getLogger(TestMasterShutdown.class); + private HBaseTestingUtility htu; + + @Before + public void shutdownCluster() throws IOException { + if (htu != null) { Review comment: I'm not exactly sure what the junit contract is on executing `finally` clauses and `after` method in the face of timeouts, as implemented with our classifier rule. I was being extra-special redundant with this cleanup. Probably one or the other is fine. Let me see if i can understand what junit does. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services