You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2021/12/25 01:14:56 UTC
[GitHub] [logging-log4j2] Marcono1234 commented on a change in pull request #658: Fix tests not restoring system properties
Marcono1234 commented on a change in pull request #658:
URL: https://github.com/apache/logging-log4j2/pull/658#discussion_r775094711
##########
File path: log4j-core/src/test/java/org/apache/logging/log4j/core/Log4j1222Test.java
##########
@@ -34,8 +34,13 @@
@Test
public void homepageRendersSuccessfully()
{
- System.setProperty("log4j.configurationFile", "log4j2-console.xml");
- Runtime.getRuntime().addShutdownHook(new ShutdownHook());
+ System.setProperty("log4j.configurationFile", "log4j2-console.xml");
+ try {
+ // TODO: Does not work correctly; when shutdown hook fails test has already finished successfully
Review comment:
Added this comment because test might be misleading. Test "failures" would most likely not actually cause test to fail.
##########
File path: log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java
##########
@@ -63,7 +63,6 @@ public static void beforeClass() {
@BeforeEach
public void before() {
- System.setProperty(LOG4J_SKIP_JANSI, "true");
Review comment:
Have removed this because it is set in the `beforeClass` method above already.
##########
File path: log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest.java
##########
@@ -71,17 +77,17 @@ public void testAdditivity() throws Exception {
@Test
public void testIncludeLocationDefaultsToFalse() {
- final LoggerConfig rootLoggerConfig =
Review comment:
Have fixed some inconsistent indentation here (mixed tabs and spaces).
--
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: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org