Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-26244

Avoid trim the error stack trace when running UT with maven

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha-1, 2.4.5
    • Fix Version/s: 1.4.14, 2.5.0, 3.0.0-alpha-2, 1.7.2, 2.4.6, 2.3.7
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      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:

      [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)
              ....
      

      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 .
      If I turned off the trimStackTrace, the whole stack trace is displayed, which is convenient to locate the root cause:

          [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)
              .....
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                comnetwork chenglei
                Reporter:
                comnetwork chenglei
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: