Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-13470

GenericTestUtils$LogCapturer is flaky

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      GenericTestUtils$LogCapturer is useful for assertions against service logs. However it should be fixed in following aspects:

      1. In the constructor, it uses the stdout appender's layout.
        Layout layout = Logger.getRootLogger().getAppender("stdout").getLayout();
        

        However, the stdout appender may be named "console" or alike which makes the constructor throw NPE. Actually the layout does not matter and we can use a default pattern layout that only captures application logs.

      2. stopCapturing() method is not working. The major reason is that the appender internal variable is never assigned and thus removing it to stop capturing makes no sense.
      3. It does not support org.slf4j.Logger which is preferred to log4j in many modules.
      4. There is no unit test for it.

      This jira is to address these.

      Attachments

        1. HADOOP-13470.002.patch
          5 kB
          Mingliang Liu
        2. HADOOP-13470.001.patch
          4 kB
          Mingliang Liu
        3. HADOOP-13470.000.patch
          4 kB
          Mingliang Liu

        Issue Links

          Activity

            People

              liuml07 Mingliang Liu
              liuml07 Mingliang Liu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: