Copilot commented on code in PR #7992:
URL: https://github.com/apache/hbase/pull/7992#discussion_r2999635329
##########
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/MRIncrementalLoadTestBase.java:
##########
@@ -110,17 +102,16 @@ public void setUp() throws IOException {
Table table = UTIL.createTable(tableName, FAMILIES, splitKeys);
RegionLocator r = UTIL.getConnection().getRegionLocator(tableName);
- assertEquals("Should start with empty table", 0,
HBaseTestingUtil.countRows(table));
+ assertEquals(0, HBaseTestingUtil.countRows(table), "Should start with
empty table");
int numRegions = r.getStartKeys().length;
- assertEquals("Should make " + regionNum + " regions", numRegions,
regionNum);
+ assertEquals(numRegions, regionNum, "Should make " + regionNum + "
regions");
Review Comment:
In JUnit 5, `assertEquals(expected, actual, message)` reports expected vs
actual values on failure. Here `numRegions` (actual) and `regionNum` (expected)
are reversed, which will produce confusing diagnostics if the assertion fails.
Swap the arguments so `regionNum` is the expected value and `numRegions` is the
actual value.
```suggestion
assertEquals(regionNum, numRegions, "Should make " + regionNum + "
regions");
```
--
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]