Bug: Avoid trim the error stack trace when running UT with maven
Status: Resolved | Priority: Major | Resolution: Fixed
Created: 31/Aug/21 14:05
Affects Version/s: 2.4.5

When running HBase unit test with maven, if there is failed test，I always find that the error stack trace was trimmed,  which make it is hard to locate the root cause.
Just see the following stack trace as an example:
{code:java}
[INFO] Running org.apache.hadoop.hbase.regionserver.TestHStore
[ERROR] Tests run: 32, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 34.516 s <<< FAILURE! - in org.apache.hadoop.hbase.regionserver.TestHStore
[ERROR] org.apache.hadoop.hbase.regionserver.TestHStore.testCompactingMemStoreWriteLargeCellAndSmallCellConcurrently  Time elapsed: 0.44 s  <<< FAILURE!
java.lang.AssertionError
        at org.apache.hadoop.hbase.regionserver.TestHStore.doWriteTestLargeCellAndSmallCellConcurrently(TestHStore.java:1919)
        at org.apache.hadoop.hbase.regionserver.TestHStore.testCompactingMemStoreWriteLargeCellAndSmallCellConcurrently(TestHStore.java:1819)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        ....
{code}
There is no {{Assert}} in {{TestHStore.java:1919}}, the {{AssertionError}} is thrown by method called by {{TestHStore.doWriteTestLargeCellAndSmallCellConcurrently}}, the error stack trace which actually throws  {{AssertionError}}  is trimmed by {{maven-surefire-plugin}}  because of the default setting, just see [trimStackTrace|http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#trimStackTrace] .
If  I turned off the {{trimStackTrace}}, the whole stack trace is displayed, which is convenient to locate the root cause:
{code:java}
    [ERROR] org.apache.hadoop.hbase.regionserver.TestHStore.testCompactingMemStoreWriteLargeCellAndSmallCellConcurrently  Time elapsed: 0.44 s  <<< FAILURE!
java.lang.AssertionError
        at org.junit.Assert.fail(Assert.java:87)
        at org.junit.Assert.assertTrue(Assert.java:42)
        at org.junit.Assert.assertTrue(Assert.java:53)
        at org.apache.hadoop.hbase.regionserver.TestHStore$MyCompactingMemStore3.flushInMemory(TestHStore.java:2267)
        at org.apache.hadoop.hbase.regionserver.CompactingMemStore.tryFlushInMemoryAndCompactingAsync(CompactingMemStore.java:460)
        at org.apache.hadoop.hbase.regionserver.CompactingMemStore.checkAndAddToActiveSize(CompactingMemStore.java:446)
        at org.apache.hadoop.hbase.regionserver.TestHStore$MyCompactingMemStore3.checkAndAddToActiveSize(TestHStore.java:2238)
        at org.apache.hadoop.hbase.regionserver.CompactingMemStore.preUpdate(CompactingMemStore.java:317)
        at org.apache.hadoop.hbase.regionserver.AbstractMemStore.doAddOrUpsert(AbstractMemStore.java:149)
        at org.apache.hadoop.hbase.regionserver.AbstractMemStore.add(AbstractMemStore.java:122)
        at org.apache.hadoop.hbase.regionserver.HStore.add(HStore.java:730)
        at org.apache.hadoop.hbase.regionserver.TestHStore.doWriteTestLargeCellAndSmallCellConcurrently(TestHStore.java:1919)
        at org.apache.hadoop.hbase.regionserver.TestHStore.testCompactingMemStoreWriteLargeCellAndSmallCellConcurrently(TestHStore.java:1819)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        .....
{code}