Skip to content

Commit

Permalink
Logging: Fix test on windows
Browse files Browse the repository at this point in the history
Windows' `\` instead of `/` strikes again!

Closes #32546
  • Loading branch information
nik9000 committed Aug 9, 2018
1 parent 175dd83 commit 67b35dc
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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;
Expand Down Expand Up @@ -360,7 +361,6 @@ public void testProperties() throws IOException, UserException {
}
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/32546")
public void testNoNodeNameWarning() throws IOException, UserException {
setupLogging("no_node_name");

Expand All @@ -376,7 +376,11 @@ public void testNoNodeNameWarning() throws IOException, UserException {
+ "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 {
Expand Down

0 comments on commit 67b35dc

Please sign in to comment.