Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8BB8A200B71 for ; Wed, 17 Aug 2016 01:19:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8A5AF160ABD; Tue, 16 Aug 2016 23:19:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D8819160ABA for ; Wed, 17 Aug 2016 01:19:21 +0200 (CEST) Received: (qmail 97250 invoked by uid 500); 16 Aug 2016 23:19:21 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 97153 invoked by uid 99); 16 Aug 2016 23:19:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Aug 2016 23:19:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id AF8E82C02AE for ; Tue, 16 Aug 2016 23:19:20 +0000 (UTC) Date: Tue, 16 Aug 2016 23:19:20 +0000 (UTC) From: "Chris Nauroth (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-13470) GenericTestUtils$LogCapturer is flaky MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 16 Aug 2016 23:19:22 -0000 [ https://issues.apache.org/jira/browse/HADOOP-13470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15423577#comment-15423577 ] Chris Nauroth commented on HADOOP-13470: ---------------------------------------- bq. A simple fix is to use default {{PatternLayout}} only if the {{stdout}} and {{console}} appender are not defined. That sounds perfect. That would be backward-compatible for any existing tests that rely on a specific pattern in log4j.properties. Thanks! Please feel free to notify me for code review on the new patch, and I'll try {{TestFileSystemOperationsWithThreads}} with it. > GenericTestUtils$LogCapturer is flaky > ------------------------------------- > > Key: HADOOP-13470 > URL: https://issues.apache.org/jira/browse/HADOOP-13470 > Project: Hadoop Common > Issue Type: Bug > Components: test, util > Affects Versions: 2.8.0 > Reporter: Mingliang Liu > Assignee: Mingliang Liu > Labels: reviewed > Fix For: 2.8.0 > > Attachments: HADOOP-13470.000.patch, HADOOP-13470.001.patch > > > {{GenericTestUtils$LogCapturer}} is useful for assertions against service logs. However it should be fixed in following aspects: > # In the constructor, it uses the stdout appender's layout. > {code} > Layout layout = Logger.getRootLogger().getAppender("stdout").getLayout(); > {code} > 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. > # {{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. > # It does not support {{org.slf4j.Logger}} which is preferred to log4j in many modules. > # There is no unit test for it. > This jira is to address these. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-issues-help@hadoop.apache.org