Copilot commented on code in PR #8107:
URL: https://github.com/apache/hbase/pull/8107#discussion_r3109877144
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterTruncateTestBase.java:
##########
@@ -19,15 +19,19 @@
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils;
-import org.junit.Test;
+import org.junit.jupiter.api.TestTemplate;
public class RestoreSnapshotFromClientAfterTruncateTestBase
extends RestoreSnapshotFromClientTestBase {
- @Test
+ protected RestoreSnapshotFromClientAfterTruncateTestBase(int numReplicas) {
+ super(numReplicas);
+ }
+
+ @TestTemplate
public void testRestoreSnapshotAfterTruncate() throws Exception {
TableName tableName = TableName.valueOf(getValidMethodName());
- SnapshotTestingUtils.createTable(TEST_UTIL, tableName, getNumReplicas(),
FAMILY);
+ SnapshotTestingUtils.createTable(TEST_UTIL, tableName, numReplicas,
FAMILY);
SnapshotTestingUtils.loadData(TEST_UTIL, tableName, 500, FAMILY);
Review Comment:
`testRestoreSnapshotAfterTruncate` creates and operates on a separate local
`tableName` (shadowing the instance field), but `@AfterEach` in
`RestoreSnapshotFromClientTestBase` only deletes the instance field table. This
leaves the truncate-test table behind after each invocation, which can
accumulate across parameter runs and other tests in the same JVM. Consider
reusing the instance `tableName` created in `@BeforeEach`, or explicitly delete
the locally-created table (e.g., via `TEST_UTIL.deleteTableIfAny(...)`) in a
`finally`/`@AfterEach` hook for this test.
--
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]