You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Henry Robinson (JIRA)" <ji...@apache.org> on 2010/01/23 00:04:21 UTC

[jira] Created: (ZOOKEEPER-654) Tests should not rely on CONSOLE appender being present

Tests should not rely on CONSOLE appender being present
-------------------------------------------------------

                 Key: ZOOKEEPER-654
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-654
             Project: Zookeeper
          Issue Type: Bug
    Affects Versions: 3.2.1
            Reporter: Henry Robinson
            Priority: Minor


Tests have been failing for us in an environment where we removed the CONSOLE appender from log4j. This breaks a couple of tests in QuorumPeerMainTest at least.

I have fixed in our builds by replacing CONSOLE with ROLLINGFILE (which we are using) for the time being, but messing with the log config shouldn't break tests. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-654) Tests should not rely on CONSOLE appender being present

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803950#action_12803950 ] 

Patrick Hunt commented on ZOOKEEPER-654:
----------------------------------------

"logged at all" should be sufficient, if that works great.

regardless we should also have a dedicated log4j config file to keep any changes in conf from effecting the tests and their output.


> Tests should not rely on CONSOLE appender being present
> -------------------------------------------------------
>
>                 Key: ZOOKEEPER-654
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-654
>             Project: Zookeeper
>          Issue Type: Bug
>    Affects Versions: 3.2.1
>            Reporter: Henry Robinson
>            Priority: Minor
>
> Tests have been failing for us in an environment where we removed the CONSOLE appender from log4j. This breaks a couple of tests in QuorumPeerMainTest at least.
> I have fixed in our builds by replacing CONSOLE with ROLLINGFILE (which we are using) for the time being, but messing with the log config shouldn't break tests. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-654) Tests should not rely on CONSOLE appender being present

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803945#action_12803945 ] 

Patrick Hunt commented on ZOOKEEPER-654:
----------------------------------------

it's difficult to test this particular functionality (ie verifying we log something in certain cases) without this approach. 

Are you saying we should have a dedicated log4j configuration file as part of test, rather than relying on the one in conf?
That would be fine w/me.


> Tests should not rely on CONSOLE appender being present
> -------------------------------------------------------
>
>                 Key: ZOOKEEPER-654
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-654
>             Project: Zookeeper
>          Issue Type: Bug
>    Affects Versions: 3.2.1
>            Reporter: Henry Robinson
>            Priority: Minor
>
> Tests have been failing for us in an environment where we removed the CONSOLE appender from log4j. This breaks a couple of tests in QuorumPeerMainTest at least.
> I have fixed in our builds by replacing CONSOLE with ROLLINGFILE (which we are using) for the time being, but messing with the log config shouldn't break tests. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-654) Tests should not rely on CONSOLE appender being present

Posted by "Henry Robinson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803948#action_12803948 ] 

Henry Robinson commented on ZOOKEEPER-654:
------------------------------------------

It seems like the code is retrieving a Layout object for log4j which it uses to format output to a custom appender. Is there a way of programmatically creating a Layout that will do the same thing? 

Something like this:

Layout layout = new SimpleLayout();

passes tests for me.

It depends, is the idea that we test that something is logged under the default log4j layout? Or that it gets logged at all (and using any layout that prints out messages will do)?



> Tests should not rely on CONSOLE appender being present
> -------------------------------------------------------
>
>                 Key: ZOOKEEPER-654
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-654
>             Project: Zookeeper
>          Issue Type: Bug
>    Affects Versions: 3.2.1
>            Reporter: Henry Robinson
>            Priority: Minor
>
> Tests have been failing for us in an environment where we removed the CONSOLE appender from log4j. This breaks a couple of tests in QuorumPeerMainTest at least.
> I have fixed in our builds by replacing CONSOLE with ROLLINGFILE (which we are using) for the time being, but messing with the log config shouldn't break tests. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-654) Tests should not rely on CONSOLE appender being present

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-654?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-654:
-----------------------------------

    Attachment:     (was: ZOOKEEPER-495.patch)

> Tests should not rely on CONSOLE appender being present
> -------------------------------------------------------
>
>                 Key: ZOOKEEPER-654
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-654
>             Project: Zookeeper
>          Issue Type: Bug
>    Affects Versions: 3.2.1
>            Reporter: Henry Robinson
>            Priority: Minor
>
> Tests have been failing for us in an environment where we removed the CONSOLE appender from log4j. This breaks a couple of tests in QuorumPeerMainTest at least.
> I have fixed in our builds by replacing CONSOLE with ROLLINGFILE (which we are using) for the time being, but messing with the log config shouldn't break tests. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-654) Tests should not rely on CONSOLE appender being present

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-654?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-654:
-----------------------------------

    Comment: was deleted

(was: I updated the code to only output for non-session events. session event's don't have paths (zero len str)

No tests as the current tests were causing this error to be output, I verified that the log is not being output in this case.)

> Tests should not rely on CONSOLE appender being present
> -------------------------------------------------------
>
>                 Key: ZOOKEEPER-654
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-654
>             Project: Zookeeper
>          Issue Type: Bug
>    Affects Versions: 3.2.1
>            Reporter: Henry Robinson
>            Priority: Minor
>
> Tests have been failing for us in an environment where we removed the CONSOLE appender from log4j. This breaks a couple of tests in QuorumPeerMainTest at least.
> I have fixed in our builds by replacing CONSOLE with ROLLINGFILE (which we are using) for the time being, but messing with the log config shouldn't break tests. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-654) Tests should not rely on CONSOLE appender being present

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-654?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-654:
-----------------------------------

    Attachment: ZOOKEEPER-495.patch

I updated the code to only output for non-session events. session event's don't have paths (zero len str)

No tests as the current tests were causing this error to be output, I verified that the log is not being output in this case.

> Tests should not rely on CONSOLE appender being present
> -------------------------------------------------------
>
>                 Key: ZOOKEEPER-654
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-654
>             Project: Zookeeper
>          Issue Type: Bug
>    Affects Versions: 3.2.1
>            Reporter: Henry Robinson
>            Priority: Minor
>         Attachments: ZOOKEEPER-495.patch
>
>
> Tests have been failing for us in an environment where we removed the CONSOLE appender from log4j. This breaks a couple of tests in QuorumPeerMainTest at least.
> I have fixed in our builds by replacing CONSOLE with ROLLINGFILE (which we are using) for the time being, but messing with the log config shouldn't break tests. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.