Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-3900

Make BaseTokenStreamTestCase.checkRandomData more debuggable

    Details

    • Type: Task
    • Status: Open
    • Priority: 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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: