Niklas Semmler created FLINK-26710: -------------------------------------- Summary: 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 Reporter: Niklas Semmler
{{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)