You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Chesnay Schepler (Jira)" <ji...@apache.org> on 2022/04/07 15:26:00 UTC

[jira] [Closed] (FLINK-26710) TestLoggerResource hides log lines

     [ https://issues.apache.org/jira/browse/FLINK-26710?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chesnay Schepler closed FLINK-26710.
------------------------------------
    Fix Version/s: 1.16.0
         Assignee: Niklas Semmler
       Resolution: Fixed

master: 4d6732587cbc53d018b35a749d8a0079b338c45b

> TestLoggerResource hides log lines
> ----------------------------------
>
>                 Key: FLINK-26710
>                 URL: https://issues.apache.org/jira/browse/FLINK-26710
>             Project: Flink
>          Issue Type: Bug
>          Components: Test Infrastructure
>    Affects Versions: 1.15.0, 1.16.0
>            Reporter: Niklas Semmler
>            Assignee: Niklas Semmler
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.16.0
>
>
> {{org.apache.flink.testutils.logging.TestLoggerResource}} makes log lines accessible to tests. It extends {{org.junit.rules.ExternalResource}} and thus can be used as a rule. Example for its use can be found [here|https://github.com/apache/flink/blob/c6997c97c575d334679915c328792b8a3067cfb5/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerProcessUtilsTest.java#L145].
> Unfortunately, the current implementation consumes *all* log lines of a {{Logger}} in such a way that they are not forwarded to the general log output. As such, someone debugging a test will not have access to log lines and this can complicate debugging. The implementation needs to be changed to non-exclusively consume log lines.
> In a first attempt, we enabled the {{additivity}} of the {{Logger}} created by {{TestLoggerResource}}. This works only for the case were both the {{Logger}} created by {{TestLoggerResource}} and the parent {{Logger}} use the same log level. When they use different log levels, the {{TestLoggerResource}} {{Logger}} overwrites the log level. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)