From abda9fdac1f8e300e73f1ba22d8e336831f35c4b Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Thu, 9 Aug 2018 14:35:30 -0400 Subject: [PATCH] Logging: Fix test on windows Windows' `\` instead of `/` strikes again! Closes #32546 --- .../org/elasticsearch/common/logging/EvilLoggerTests.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java b/qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java index ff9e1cb4ded..f92257fc91b 100644 --- a/qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java +++ b/qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java @@ -28,6 +28,7 @@ import org.apache.logging.log4j.core.appender.ConsoleAppender; import org.apache.logging.log4j.core.appender.CountingNoOpAppender; import org.apache.logging.log4j.core.config.Configurator; import org.apache.logging.log4j.message.ParameterizedMessage; +import org.apache.lucene.util.Constants; import org.elasticsearch.cli.UserException; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.common.Randomness; @@ -360,7 +361,6 @@ public class EvilLoggerTests extends ESTestCase { } } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/32546") public void testNoNodeNameWarning() throws IOException, UserException { setupLogging("no_node_name"); @@ -376,7 +376,11 @@ public class EvilLoggerTests extends ESTestCase { + "have %node_name. We will automatically add %node_name to the pattern to ease the migration for users " + "who customize log4j2.properties but will stop this behavior in 7.0. You should manually replace " + "`%node_name` with `\\[%node_name\\]%marker ` in these locations:"); - assertThat(events.get(1), endsWith("no_node_name/log4j2.properties")); + if (Constants.WINDOWS) { + assertThat(events.get(1), endsWith("no_node_name\\log4j2.properties")); + } else { + assertThat(events.get(1), endsWith("no_node_name/log4j2.properties")); + } } private void setupLogging(final String config) throws IOException, UserException {