Lucene - Core
  1. Lucene - Core
  2. LUCENE-2338

Some tests catch Exceptions in separate threads and just print a stack trace - the test does not fail

    Details

    • Type: Test Test
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 4.9, 5.0
    • Component/s: general/build
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Some tests catch Exceptions in separate threads and just print a stack trace - the test does not fail. The test should fail. Since LUCENE-2274, the LuceneTestCase(J4) class installs an UncaughtExceptionHandler, so this type of catching and solely printing a Stack trace is a bad idea. Problem is, that the run() method of threads is not allowed to throw checked Exceptions.

      Two possibilities:

      • Catch checked Exceptions in the run() method and wrap into RuntimeException or call Assert.fail() instead
      • Use Executors

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Uwe Schindler
              Reporter:
              Uwe Schindler
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development