Copilot commented on code in PR #7861:
URL: https://github.com/apache/hbase/pull/7861#discussion_r2981414057
##########
hbase-mapreduce/pom.xml:
##########
@@ -191,11 +191,6 @@
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.junit.vintage</groupId>
- <artifactId>junit-vintage-engine</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
Review Comment:
The `junit-vintage-engine` dependency was removed, but there are still JUnit
4-based tests in this module (e.g., `TestJarFinder` still uses
`org.junit.Test`). Without the Vintage engine those tests will be skipped
entirely.
Suggested fix: either migrate the remaining JUnit 4 tests to JUnit Jupiter
before removing Vintage, or keep Vintage until all JUnit 4 tests are converted.
```suggestion
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
```
##########
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyReplicationAdjunct.java:
##########
@@ -352,9 +341,8 @@ public void testVerifyReplicationWithSnapshotSupport()
throws Exception {
TestVerifyReplicationZkClusterKey.checkRestoreTmpDir(CONF2, temPath2, 2);
}
- @AfterClass
+ @AfterAll
public static void tearDownAfterClass() throws Exception {
htable3.close();
- TestReplicationBase.tearDownAfterClass();
}
Review Comment:
`tearDownAfterClass` no longer delegates to
`TestReplicationBase.tearDownAfterClass()`. Since this class also hides the
superclass method, the mini clusters/connections started by
`TestReplicationBase` may never be shut down, leading to leaked resources and
follow-on test failures.
Suggested fix: add `TestReplicationBase.tearDownAfterClass()` after closing
`htable3` (or rename this method to avoid hiding and rely on inherited
`@AfterAll`).
##########
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestJarFinder.java:
##########
@@ -30,24 +30,18 @@
import java.util.jar.JarInputStream;
import java.util.jar.JarOutputStream;
import java.util.jar.Manifest;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.testclassification.SmallTests;
import org.junit.Assert;
-import org.junit.ClassRule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.Tag;
import org.slf4j.LoggerFactory;
/**
* This file was forked from hadoop/common/branches/branch-2@1350012.
*/
-@Category(SmallTests.class)
+@Tag(SmallTests.TAG)
public class TestJarFinder {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestJarFinder.class);
-
@Test
public void testJar() throws Exception {
Review Comment:
This test still imports and uses JUnit 4 (`org.junit.Test` /
`org.junit.Assert`). With the removal of the `junit-vintage-engine` in this
module, it will no longer be executed on the JUnit Platform.
Suggested fix: migrate the remaining JUnit 4 annotations/assertions to JUnit
Jupiter (e.g., `org.junit.jupiter.api.Test` and
`org.junit.jupiter.api.Assertions`).
--
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]