Copilot commented on code in PR #8201:
URL: https://github.com/apache/hbase/pull/8201#discussion_r3199474359
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java:
##########
@@ -184,7 +180,7 @@ public void testRSAbortWithUnflushedEdits() throws
Exception {
* declared it dead and started to split. Want log rolling after a master
split to fail. See
* HBASE-2312.
*/
- @Test
+ @TestTemplate
public void testLogRollAfterSplitStart() throws IOException {
LOG.info("Verify wal roll after split starts will fail.");
Review Comment:
Same issue here: `@TestTemplate` is used without any registered
`TestTemplateInvocationContextProvider` for this class. Convert this to `@Test`
(or annotate/register the intended template provider).
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALCellCodecWithCompression.java:
##########
@@ -42,53 +43,45 @@
import org.apache.hadoop.hbase.testclassification.RegionServerTests;
import org.apache.hadoop.hbase.testclassification.SmallTests;
import org.apache.hadoop.hbase.util.Bytes;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-@Category({ RegionServerTests.class, SmallTests.class })
-@RunWith(Parameterized.class)
-public class TestWALCellCodecWithCompression {
+import org.junit.jupiter.api.TestTemplate;
+import org.junit.jupiter.params.provider.Arguments;
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestWALCellCodecWithCompression.class);
[email protected](RegionServerTests.TAG)
[email protected](SmallTests.TAG)
+@HBaseParameterizedTestTemplate
+public class TestWALCellCodecWithCompression {
- private Compression.Algorithm compression;
+ private final Compression.Algorithm compression;
public TestWALCellCodecWithCompression(Compression.Algorithm algo) {
this.compression = algo;
}
- @Parameters
- public static List<Object[]> params() {
- return HBaseTestingUtility.COMPRESSION_ALGORITHMS_PARAMETERIZED;
+ public static Stream<Arguments> parameters() {
+ return
HBaseTestingUtility.COMPRESSION_ALGORITHMS_PARAMETERIZED.stream().map(Arguments::of);
}
- @Test
+ @TestTemplate
public void testEncodeDecodeKVsWithTags() throws Exception {
doTest(false, false);
}
- @Test
+ @TestTemplate
public void testEncodeDecodeKVsWithTagsWithTagsCompression() throws
Exception {
doTest(true, false);
}
- @Test
+ @TestTemplate
public void testEncodeDecodeOffKVsWithTagsWithTagsCompression() throws
Exception {
- doTest(true, true);
+ doTest(true, false);
}
Review Comment:
`testEncodeDecodeOffKVsWithTagsWithTagsCompression` is supposed to exercise
the off-heap KV path, but it currently calls `doTest(true, false)` (same as the
on-heap tags-compression test). This leaves the off-heap + tag-compression
combination untested; pass `offheapKV=true` for this test.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java:
##########
@@ -134,7 +130,7 @@ public void tearDown() throws Exception {
* Tests that RegionServer aborts if we hit an error closing the WAL when
there are unsynced WAL
* edits. See HBASE-4282.
*/
- @Test
+ @TestTemplate
public void testRSAbortWithUnflushedEdits() throws Exception {
LOG.info("Starting testRSAbortWithUnflushedEdits()");
Review Comment:
These methods are annotated with `@TestTemplate`, but the class is not
annotated with `@HBaseParameterizedTestTemplate` (and no other
`TestTemplateInvocationContextProvider` is registered). JUnit Jupiter will fail
to execute a `@TestTemplate` without an invocation context provider; use
`@Test` here (or add the appropriate template provider).
--
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]