Copilot commented on code in PR #8271:
URL: https://github.com/apache/hbase/pull/8271#discussion_r3292857874
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java:
##########
@@ -818,7 +811,7 @@ public void testReseek() throws Exception {
StoreFileScanner s = getStoreFileScanner(reader, false, false);
s.reseek(k);
- assertNotNull("Intial reseek should position at the beginning of the
file", s.peek());
+ assertNotNull(s.peek(), "Intial reseek should position at the beginning of
the file");
Review Comment:
Typo in the assertion message: "Intial" should be "Initial".
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java:
##########
@@ -593,13 +590,13 @@ private void verifyAfterTtl(HRegion region, long ts)
throws IOException {
get.readAllVersions();
get.setTimestamp(ts - 3);
result = region.get(get);
- Assert.assertEquals(result.getColumnCells(c0, c0).size(), 0);
+ assertEquals(result.getColumnCells(c0, c0).size(), 0);
get = new Get(T1);
get.readAllVersions();
get.setTimeRange(0, ts - 2);
result = region.get(get);
- Assert.assertEquals(result.getColumnCells(c0, c0).size(), 0);
+ assertEquals(result.getColumnCells(c0, c0).size(), 0);
Review Comment:
These assertEquals calls have expected/actual arguments reversed (size()
passed as expected, 0 as actual). This won’t affect the boolean outcome but
makes failure output misleading; prefer assertEquals(0, size).
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsTableMetricsMap.java:
##########
@@ -68,14 +63,14 @@ public void testMetricsMap() throws InterruptedException {
rsm.updateCompaction(tableName, true, 100, 200, 300, 400, 500);
int metricsMapSize = agg.getMetricsRegistry().getMetricsMap().size();
- assertTrue("table metrics added then metricsMapSize should larger than 0",
metricsMapSize > 0);
+ assertTrue(metricsMapSize > 0, "table metrics added then metricsMapSize
should larger than 0");
Review Comment:
Grammar in the assertion message is off ("should larger than 0"). Consider
rephrasing to "should be larger than 0" for clarity.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServer.java:
##########
@@ -160,9 +155,9 @@ public void testWrapperSource() {
@Test
public void testConstuctor() {
- assertNotNull("There should be a hadoop1/hadoop2 metrics source",
rsm.getMetricsSource());
- assertNotNull("The RegionServerMetricsWrapper should be accessable",
- rsm.getRegionServerWrapper());
+ assertNotNull(rsm.getMetricsSource(), "There should be a hadoop1/hadoop2
metrics source");
+ assertNotNull(rsm.getRegionServerWrapper(),
+ "The RegionServerMetricsWrapper should be accessable");
Review Comment:
Typo in the assertion message: "accessable" should be "accessible".
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java:
##########
@@ -593,13 +590,13 @@ private void verifyAfterTtl(HRegion region, long ts)
throws IOException {
get.readAllVersions();
get.setTimestamp(ts - 3);
result = region.get(get);
- Assert.assertEquals(result.getColumnCells(c0, c0).size(), 0);
+ assertEquals(result.getColumnCells(c0, c0).size(), 0);
Review Comment:
These assertEquals calls have expected/actual arguments reversed (size()
passed as expected, 0 as actual). This won’t affect the boolean outcome but
makes failure output misleading; prefer assertEquals(0, size).
--
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]