Lucene - Core
  1. Lucene - Core
  2. LUCENE-3900

Make BaseTokenStreamTestCase.checkRandomData more debuggable

    Details

    • Type: Task Task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      This thing has gotten meaner recently, but if it fails, it can be tough to debug.

      I feel like usually we just look at whatever analyzer failed, and completely review the code
      and look for any smells until it passes

      So I think instead we can possibly make this easier if this does something like:

      try { 
       ...checks... 
      } catch (Throwable t) { 
        BaseTokenException e = new BaseTokenException(randomInputUsed, randomParamter1, randomParameter2); 
        e.setInitCause(t); 
        throw e; 
      }
      

      Then you could have a useful exception with the input string that caused the fail,
      information about whether or not charfilter/mockreaderwrapper/whatever were used, etc,
      as well as the initial problem as root cause.

        Activity

        Robert Muir created issue -
        Hide
        Michael McCandless added a comment -

        +1!

        Show
        Michael McCandless added a comment - +1!

          People

          • Assignee:
            Unassigned
            Reporter:
            Robert Muir
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development