From fc62214e77b62ca0291d8080be01de8a8adc9c0e Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Mon, 30 Nov 2020 14:14:44 +0800 Subject: [PATCH] HBASE-25341 Fix ErrorProne error which causes nightly to fail (#2718) Signed-off-by: Guanghao Zhang --- .../hadoop/hbase/regionserver/TestHRegion.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java index 7d1bba5c7d2..fcbc718296a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java @@ -7229,7 +7229,8 @@ public class TestHRegion { RegionInfoBuilder.newBuilder(tableName).setStartKey(a).setEndKey(c).build(); final TableDescriptor htd = TableDescriptorBuilder.newBuilder(tableName) .setColumnFamily(ColumnFamilyDescriptorBuilder.of(fam1)).build(); - region = HRegion.createHRegion(hri, TEST_UTIL.getDataTestDir(), conf, htd, TEST_UTIL.createWal(conf, TEST_UTIL.getDataTestDirOnTestFS(method + ".log"), hri)); + region = HRegion.createHRegion(hri, TEST_UTIL.getDataTestDir(), conf, htd, + HBaseTestingUtility.createWal(conf, TEST_UTIL.getDataTestDirOnTestFS(method + ".log"), hri)); Mutation[] mutations = new Mutation[] { new Put(a) @@ -7507,8 +7508,7 @@ public class TestHRegion { }); } } catch (Exception e) { - e.printStackTrace(); - assertionError.set(new AssertionError(e.getMessage())); + assertionError.set(new AssertionError(e)); } }); writerThread.start(); @@ -7533,12 +7533,12 @@ public class TestHRegion { assertEquals(2L, Bytes.toLong(result.getValue(fam1, q3))); assertEquals("ab", Bytes.toString(result.getValue(fam1, q4))); } else { - fail("the qualifier " + q1 + " should be " + v1 + " or " + v2 + ", but " + q1Value); + fail("the qualifier " + Bytes.toString(q1) + " should be " + v1 + " or " + v2 + + ", but " + q1Value); } } } catch (Exception e) { - e.printStackTrace(); - assertionError.set(new AssertionError(e.getMessage())); + assertionError.set(new AssertionError(e)); } catch (AssertionError e) { assertionError.set(e); }