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

          Hide
          Sanjoy Ghosh added a comment -

          Hi Uwe,

          I can work on this bug. Do you have any test cases to reproduce this behavior?

          Sanjoy

          Show
          Sanjoy Ghosh added a comment - Hi Uwe, I can work on this bug. Do you have any test cases to reproduce this behavior? Sanjoy
          Hide
          Uwe Schindler added a comment -

          Hi Sanjoy,

          just grep on "printStackTrace(" to find test cases that simply print out stacktraces and ignore exceptions. Possible examples can be seen also in related issues like LUCENE-1814.

          Thanks for your interest in fixing this!

          Show
          Uwe Schindler added a comment - Hi Sanjoy, just grep on "printStackTrace(" to find test cases that simply print out stacktraces and ignore exceptions. Possible examples can be seen also in related issues like LUCENE-1814 . Thanks for your interest in fixing this!
          Hide
          Michael McCandless added a comment -

          Our test framework fails tests w/ errant exceptions from threads now...

          Show
          Michael McCandless added a comment - Our test framework fails tests w/ errant exceptions from threads now...
          Hide
          Uwe Schindler added a comment -

          Were all tests already converted to not supress exceptions in threads? This is why the issue is still open...

          Show
          Uwe Schindler added a comment - Were all tests already converted to not supress exceptions in threads? This is why the issue is still open...
          Hide
          Michael McCandless added a comment -

          Were all tests already converted to not supress exceptions in threads? This is why the issue is still open...

          Oh, woops: I don't know!

          Reopening...

          Show
          Michael McCandless added a comment - Were all tests already converted to not supress exceptions in threads? This is why the issue is still open... Oh, woops: I don't know! Reopening...
          Hide
          Hoss Man added a comment -

          Issue is marked 3.6 and actively being discussed but has no assignee - assigning to most active committer contributing patches/discussion so far to triage wether this can/should be pushed to 4.0 or not.

          Show
          Hoss Man added a comment - Issue is marked 3.6 and actively being discussed but has no assignee - assigning to most active committer contributing patches/discussion so far to triage wether this can/should be pushed to 4.0 or not.
          Hide
          Uwe Schindler added a comment -

          I remove 3.x branch. I chacked all tests using e.printStackTrace() and all have some (outdated) logic to report the failure. In trunk we should rewrite those tests to simply fail()/rethrow as RuntimeEx on any Exception in threads. This way the failures are reported consistently.

          Show
          Uwe Schindler added a comment - I remove 3.x branch. I chacked all tests using e.printStackTrace() and all have some (outdated) logic to report the failure. In trunk we should rewrite those tests to simply fail()/rethrow as RuntimeEx on any Exception in threads. This way the failures are reported consistently.
          Hide
          Hoss Man added a comment -

          bulk cleanup of 4.0-ALPHA / 4.0 Jira versioning. all bulk edited issues have hoss20120711-bulk-40-change in a comment

          Show
          Hoss Man added a comment - bulk cleanup of 4.0-ALPHA / 4.0 Jira versioning. all bulk edited issues have hoss20120711-bulk-40-change in a comment
          Hide
          Robert Muir added a comment -

          rmuir20120906-bulk-40-change

          Show
          Robert Muir added a comment - rmuir20120906-bulk-40-change
          Hide
          Steve Rowe added a comment -

          Bulk move 4.4 issues to 4.5 and 5.0

          Show
          Steve Rowe added a comment - Bulk move 4.4 issues to 4.5 and 5.0
          Hide
          Uwe Schindler added a comment -

          Move issue to Lucene 4.9.

          Show
          Uwe Schindler added a comment - Move issue to Lucene 4.9.

            People

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

              Dates

              • Created:
                Updated:

                Development