Skip to content

Commit 67b35dc

Browse files
committed
Logging: Fix test on windows
Windows' `\` instead of `/` strikes again! Closes #32546
1 parent 175dd83 commit 67b35dc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.apache.logging.log4j.core.appender.CountingNoOpAppender;
2929
import org.apache.logging.log4j.core.config.Configurator;
3030
import org.apache.logging.log4j.message.ParameterizedMessage;
31+
import org.apache.lucene.util.Constants;
3132
import org.elasticsearch.cli.UserException;
3233
import org.elasticsearch.cluster.ClusterName;
3334
import org.elasticsearch.common.Randomness;
@@ -360,7 +361,6 @@ public void testProperties() throws IOException, UserException {
360361
}
361362
}
362363

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

@@ -376,7 +376,11 @@ public void testNoNodeNameWarning() throws IOException, UserException {
376376
+ "have %node_name. We will automatically add %node_name to the pattern to ease the migration for users "
377377
+ "who customize log4j2.properties but will stop this behavior in 7.0. You should manually replace "
378378
+ "`%node_name` with `\\[%node_name\\]%marker ` in these locations:");
379-
assertThat(events.get(1), endsWith("no_node_name/log4j2.properties"));
379+
if (Constants.WINDOWS) {
380+
assertThat(events.get(1), endsWith("no_node_name\\log4j2.properties"));
381+
} else {
382+
assertThat(events.get(1), endsWith("no_node_name/log4j2.properties"));
383+
}
380384
}
381385

382386
private void setupLogging(final String config) throws IOException, UserException {

0 commit comments

Comments
 (0)