Copilot commented on code in PR #8113:
URL: https://github.com/apache/hbase/pull/8113#discussion_r3129400326
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java:
##########
@@ -35,24 +34,24 @@
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread;
import org.apache.hadoop.hbase.zookeeper.MetaTableLocator;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@Category({ FlakeyTests.class, LargeTests.class })
+@Tag(FlakeyTests.TAG)
+@Tag(LargeTests.TAG)
public class TestMasterFailover {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestMasterFailover.class);
-
private static final Logger LOG =
LoggerFactory.getLogger(TestMasterFailover.class);
- @Rule
- public TestName name = new TestName();
+ private String testMethodName;
+
+ @BeforeEach
+ public void setTestMethod(TestInfo testInfo) {
+ testMethodName = testInfo.getTestMethod().get().getName();
+ }
Review Comment:
`testMethodName` is set in `@BeforeEach` but never used anywhere in this
test class. This adds dead code and can be confusing during future maintenance;
please remove the field and `setTestMethod` method (or use `testMethodName`
where intended).
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]