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

Wasted work in RollingAppenderSizeTest.testAppender() and other tests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0-beta7
    • 2.0-beta8
    • None
    • any

    Description

      The problem appears in Log4j 2.0-beta7 and in revision 1491481. I
      attached a one-line patch (patch.diff) that fixes it. This problem
      and the attached patch are similar to the previously fixed LOG4J2-273
      and LOG4J2-274, and their patches.

      In method "RollingAppenderSizeTest.testAppender", the loop over
      "files" should break immediately after "found" is set to "true". All
      the iterations after "found" is set to "true" do not perform any
      useful work, at best they just set "found" again to "true".

      Similar problems exist in
      "RollingAppenderTimeAndSizeTest.testAppender",
      "RollingAppenderTimeTest.testAppender",
      "RollingAppenderUncompressedTest.testAppender", "PerfTest.doMain", and
      "AdvertiserTest.verifyExpectedEntriesAdvertised". I attached patches
      patch2.diff, patch3.diff, patch4.diff, patch5.diff, and patch6.diff
      for these methods. I also attached a patch (patchAll.diff) that
      aggregates all these changes in one single patch.

      Attachments

        1. patch.diff
          0.6 kB
          Adrian Nistor
        2. patch2.diff
          0.7 kB
          Adrian Nistor
        3. patch3.diff
          0.6 kB
          Adrian Nistor
        4. patch4.diff
          0.7 kB
          Adrian Nistor
        5. patch5.diff
          0.6 kB
          Adrian Nistor
        6. patch6.diff
          0.7 kB
          Adrian Nistor
        7. patchAll.diff
          4 kB
          Adrian Nistor

        Activity

          People

            Unassigned Unassigned
            adriannistor Adrian Nistor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: