Skip some logging tests on JDK 9

There is a bug in Log4j on JDK 9 for walking the stack to find where a
log line is coming from. This bug is impacting some of our testing, so
this commit marks these tests as skippable only on JDK 9 until the bug
is fixed upstream.

Relates #26467
This commit is contained in:
Jason Tedor 2017-09-01 12:38:22 -04:00 committed by GitHub
parent c2853c8281
commit 19a2156d18
2 changed files with 19 additions and 6 deletions

View File

@ -7,7 +7,9 @@ spatial4j = 0.6
jts = 1.13 jts = 1.13
jackson = 2.8.6 jackson = 2.8.6
snakeyaml = 1.15 snakeyaml = 1.15
# When updating log4j, please update also docs/java-api/index.asciidoc # when updating log4j, please update also docs/java-api/index.asciidoc
# when updating this version, please check if https://github.com/apache/logging-log4j2/pull/109 is released into the version that you are
# bumping to; if it is, remove the assumeTrues in EvilLoggerTests
log4j = 2.9.0 log4j = 2.9.0
slf4j = 1.6.2 slf4j = 1.6.2

View File

@ -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;
@ -76,8 +77,10 @@ public class EvilLoggerTests extends ESTestCase {
super.tearDown(); super.tearDown();
} }
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/26464")
public void testLocationInfoTest() throws IOException, UserException { public void testLocationInfoTest() throws IOException, UserException {
assumeTrue(
"will be fixed when https://github.com/apache/logging-log4j2/pull/109 is integrated into to Log4j and we bump versions",
!Constants.JRE_IS_MINIMUM_JAVA9);
setupLogging("location_info"); setupLogging("location_info");
final Logger testLogger = ESLoggerFactory.getLogger("test"); final Logger testLogger = ESLoggerFactory.getLogger("test");
@ -103,8 +106,10 @@ public class EvilLoggerTests extends ESTestCase {
assertLogLine(events.get(4), Level.TRACE, location, "This is a trace message"); assertLogLine(events.get(4), Level.TRACE, location, "This is a trace message");
} }
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/26464")
public void testDeprecationLogger() throws IOException, UserException { public void testDeprecationLogger() throws IOException, UserException {
assumeTrue(
"will be fixed when https://github.com/apache/logging-log4j2/pull/109 is integrated into to Log4j and we bump versions",
!Constants.JRE_IS_MINIMUM_JAVA9);
setupLogging("deprecation"); setupLogging("deprecation");
final DeprecationLogger deprecationLogger = new DeprecationLogger(ESLoggerFactory.getLogger("deprecation")); final DeprecationLogger deprecationLogger = new DeprecationLogger(ESLoggerFactory.getLogger("deprecation"));
@ -131,8 +136,10 @@ public class EvilLoggerTests extends ESTestCase {
} }
} }
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/26464")
public void testConcurrentDeprecationLogger() throws IOException, UserException, BrokenBarrierException, InterruptedException { public void testConcurrentDeprecationLogger() throws IOException, UserException, BrokenBarrierException, InterruptedException {
assumeTrue(
"will be fixed when https://github.com/apache/logging-log4j2/pull/109 is integrated into to Log4j and we bump versions",
!Constants.JRE_IS_MINIMUM_JAVA9);
setupLogging("deprecation"); setupLogging("deprecation");
final DeprecationLogger deprecationLogger = new DeprecationLogger(ESLoggerFactory.getLogger("deprecation")); final DeprecationLogger deprecationLogger = new DeprecationLogger(ESLoggerFactory.getLogger("deprecation"));
@ -209,8 +216,10 @@ public class EvilLoggerTests extends ESTestCase {
} }
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/26464")
public void testDeprecationLoggerMaybeLog() throws IOException, UserException { public void testDeprecationLoggerMaybeLog() throws IOException, UserException {
assumeTrue(
"will be fixed when https://github.com/apache/logging-log4j2/pull/109 is integrated into to Log4j and we bump versions",
!Constants.JRE_IS_MINIMUM_JAVA9);
setupLogging("deprecation"); setupLogging("deprecation");
final DeprecationLogger deprecationLogger = new DeprecationLogger(ESLoggerFactory.getLogger("deprecation")); final DeprecationLogger deprecationLogger = new DeprecationLogger(ESLoggerFactory.getLogger("deprecation"));
@ -253,8 +262,10 @@ public class EvilLoggerTests extends ESTestCase {
} }
} }
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/26464")
public void testDeprecatedSettings() throws IOException, UserException { public void testDeprecatedSettings() throws IOException, UserException {
assumeTrue(
"will be fixed when https://github.com/apache/logging-log4j2/pull/109 is integrated into to Log4j and we bump versions",
!Constants.JRE_IS_MINIMUM_JAVA9);
setupLogging("settings"); setupLogging("settings");
final Setting<Boolean> setting = Setting.boolSetting("deprecated.foo", false, Setting.Property.Deprecated); final Setting<Boolean> setting = Setting.boolSetting("deprecated.foo", false, Setting.Property.Deprecated);