virajjasani commented on PR #5451:
URL: https://github.com/apache/hadoop/pull/5451#issuecomment-1455168482
I also wrote test like this to verify that it doesn't print anything when
run simultaneously with both TestFsck and TestAuditLogs:
```
@Test
public void t1() throws Exception {
LogCapturer l = LogCapturer.captureLogs(FSNamesystem.AUDIT_LOG);
Thread.sleep(5000);
String str = l.getOutput();
System.out.println(str);
l.stopCapturing();
}
```
Hence, to this point, the above PR is sufficient IMO. However, I do see that
other tests do need to cleanup the appender instances that they have used,
which they are not doing as of today.
As a separate follow-up Jira, I want to propose that we make LogCapturer as
closeable and every test can either use try-with-resource or use close()
directly and as part of the close, it should do appender cleanup so that it
doesn't burden log4j with unnecessary appends. If you agree with this
@ayushtkn, I will create sub-task.
Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]