Logging: Fix test on windows
Windows' `\` instead of `/` strikes again! Closes #32546
This commit is contained in:
parent
9a16491ebf
commit
abda9fdac1
|
@ -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.appender.CountingNoOpAppender;
|
||||||
import org.apache.logging.log4j.core.config.Configurator;
|
import org.apache.logging.log4j.core.config.Configurator;
|
||||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||||
|
import org.apache.lucene.util.Constants;
|
||||||
import org.elasticsearch.cli.UserException;
|
import org.elasticsearch.cli.UserException;
|
||||||
import org.elasticsearch.cluster.ClusterName;
|
import org.elasticsearch.cluster.ClusterName;
|
||||||
import org.elasticsearch.common.Randomness;
|
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 {
|
public void testNoNodeNameWarning() throws IOException, UserException {
|
||||||
setupLogging("no_node_name");
|
setupLogging("no_node_name");
|
||||||
|
|
||||||
|
@ -376,8 +376,12 @@ public class EvilLoggerTests extends ESTestCase {
|
||||||
+ "have %node_name. We will automatically add %node_name to the pattern to ease the migration for users "
|
+ "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 "
|
+ "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:");
|
+ "`%node_name` with `\\[%node_name\\]%marker ` in these locations:");
|
||||||
|
if (Constants.WINDOWS) {
|
||||||
|
assertThat(events.get(1), endsWith("no_node_name\\log4j2.properties"));
|
||||||
|
} else {
|
||||||
assertThat(events.get(1), endsWith("no_node_name/log4j2.properties"));
|
assertThat(events.get(1), endsWith("no_node_name/log4j2.properties"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void setupLogging(final String config) throws IOException, UserException {
|
private void setupLogging(final String config) throws IOException, UserException {
|
||||||
setupLogging(config, Settings.EMPTY);
|
setupLogging(config, Settings.EMPTY);
|
||||||
|
|
Loading…
Reference in New Issue