Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-602

Several unit tests are too spammy in the build log

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-rc1
    • None
    • Core

    Description

      When I build the project using mvn clean install, I get a ton of irrelevant information about various tests. There are a few tests that intentionally throw an exception (e.g., for testing the FailoverAppender) with messages like "always fail" or "test". Now as a human, I can tell that those tests work as expected. However, as a robot, I wouldn't be able to tell the difference between test exception stack traces and actual problems with the tests.

      In fact, some CI systems will consider such error output to be a build problem and won't mark the build as successful. See, for instance, my attempted build on travis-ci.org. These debug messages, while useful in development, really ought to be a build profile setting (however that would be done in Maven; or if there's a way to mix in the string lookup plugins with a maven property).

      I'm actually wondering if all the exception stack traces there are even expected. If they are, couldn't we use @Test(expected = SQLException.class) or whatever the syntax is?

      Attachments

        Activity

          People

            Unassigned Unassigned
            mattsicker Matt Sicker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: