Copilot commented on code in PR #8112:
URL: https://github.com/apache/hbase/pull/8112#discussion_r3128780155


##########
hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestMasterAbortWhileMergingTable.java:
##########
@@ -96,11 +92,11 @@ public void test() throws Exception {
       && UTIL.getMiniHBaseCluster().getMaster().isInitialized());
     UTIL.waitFor(30000,
       () -> 
UTIL.getMiniHBaseCluster().getMaster().getMasterProcedureExecutor().isFinished(procID));
-    Assert.assertTrue(
-      "Found region RIT, that's impossible! "
-        + 
UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager().getRegionsInTransition(),
+    assertTrue(
       
UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager().getRegionsInTransition().size()
-          == 0);
+          == 0,
+      "Found region RIT, that's impossible! "
+        + 
UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager().getRegionsInTransition());

Review Comment:
   The assertion uses `size() == 0`, which is harder to read and produces less 
focused diagnostics than `isEmpty()`/`assertEquals(0, size, ...)`. Consider 
asserting `getRegionsInTransition().isEmpty()` (or `assertEquals(0, ..., ...)`) 
for clarity; optionally use the message-supplier overload to avoid building the 
expensive string when the assertion passes.



##########
hbase-common/src/test/java/org/apache/hadoop/hbase/TableNameTestRule.java:
##########
@@ -23,7 +23,13 @@
 /**
  * Returns a {@code TableName} based on currently running test method name. 
Supports tests built on
  * the {@link org.junit.runners.Parameterized} runner.
+ * @deprecated Use {@link TableNameTestExtension} instead, once we finish the 
migration of JUnit5,
+ *             which means we do not need {@link TableNameTestRule} any more, 
we can remove these
+ *             dependencies, see
+ *             <a 
href="https://issues.apache.org/jira/browse/HBASE-23671";>HBASE-23671</a> for 
more
+ *             details.
  */
+@Deprecated

Review Comment:
   The new deprecation Javadoc is a bit unclear/grammatically awkward (e.g., 
'migration of JUnit5', 'remove these dependencies'). Consider rewording to 
'migration to JUnit 5' and 'remove this dependency' (or explicitly name what 
dependencies), and optionally add `@Deprecated(since = \"...\")` to make the 
deprecation metadata more actionable.



-- 
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]

Reply via email to