diff --git a/Jenkinsfile b/Jenkinsfile index a966bf26d94..85dd0e2f8bb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -142,6 +142,7 @@ pipeline { } } + // Remove this when all tests pass with JDK 16 stage('JDK 15 and Scala 2.13') { agent { label 'ubuntu' } tools { @@ -161,6 +162,25 @@ pipeline { } } + stage('JDK 16 and Scala 2.13') { + agent { label 'ubuntu' } + tools { + jdk 'jdk_16_latest' + } + options { + timeout(time: 8, unit: 'HOURS') + timestamps() + } + environment { + SCALA_VERSION=2.13 + } + steps { + doValidation() + doTest(env) + echo 'Skipping Kafka Streams archetype test for Java 16' + } + } + stage('ARM') { agent { label 'arm4' } options { @@ -231,14 +251,14 @@ pipeline { } } - stage('JDK 15 and Scala 2.12') { + stage('JDK 16 and Scala 2.12') { when { not { changeRequest() } beforeAgent true } agent { label 'ubuntu' } tools { - jdk 'jdk_15_latest' + jdk 'jdk_16_latest' } options { timeout(time: 8, unit: 'HOURS') @@ -250,7 +270,7 @@ pipeline { steps { doValidation() doTest(env) - echo 'Skipping Kafka Streams archetype test for Java 15' + echo 'Skipping Kafka Streams archetype test for Java 16' } } } diff --git a/build.gradle b/build.gradle index b25914bb4b3..e579e7ac18e 100644 --- a/build.gradle +++ b/build.gradle @@ -102,6 +102,8 @@ ext { defaultMaxHeapSize = "2g" defaultJvmArgs = ["-Xss4m", "-XX:+UseParallelGC"] + if (JavaVersion.current() == JavaVersion.VERSION_16) + defaultJvmArgs.add("--illegal-access=permit") userMaxForks = project.hasProperty('maxParallelForks') ? maxParallelForks.toInteger() : null userIgnoreFailures = project.hasProperty('ignoreFailures') ? ignoreFailures : false @@ -353,6 +355,27 @@ subprojects { } } + // The suites are for running sets of tests in IDEs. + // Gradle will run each test class, so we exclude the suites to avoid redundantly running the tests twice. + def testsToExclude = ['**/*Suite.class'] + // Exclude PowerMock tests when running with Java 16 until a version of PowerMock that supports Java 16 is released + // The relevant issues are https://github.com/powermock/powermock/issues/1094 and https://github.com/powermock/powermock/issues/1099 + if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16)) { + testsToExclude.addAll([ + // connect tests + "**/AbstractHerderTest.*", "**/ConnectClusterStateImplTest.*", "**/ConnectorPluginsResourceTest.*", + "**/ConnectorsResourceTest.*", "**/DistributedHerderTest.*", "**/FileOffsetBakingStoreTest.*", + "**/ErrorHandlingTaskTest.*", "**/KafkaConfigBackingStoreTest.*", "**/KafkaOffsetBackingStoreTest.*", + "**/KafkaBasedLogTest.*", "**/OffsetStorageWriterTest.*", "**/StandaloneHerderTest.*", + "**/SourceTaskOffsetCommitterTest.*", "**/WorkerConfigTransformerTest.*", "**/WorkerGroupMemberTest.*", + "**/WorkerSinkTaskTest.*", "**/WorkerSinkTaskThreadedTest.*", "**/WorkerSourceTaskTest.*", + "**/WorkerTaskTest.*", "**/WorkerTest.*", "**/RestServerTest.*", + // streams tests + "**/KafkaStreamsTest.*", "**/RepartitionTopicsTest.*", "**/RocksDBMetricsRecorderTest.*", + "**/StreamsMetricsImplTest.*", "**/StateManagerUtilTest.*", "**/TableSourceNodeTest.*" + ]) + } + test { maxParallelForks = userMaxForks ?: Runtime.runtime.availableProcessors() ignoreFailures = userIgnoreFailures @@ -367,9 +390,7 @@ subprojects { } logTestStdout.rehydrate(delegate, owner, this)() - // The suites are for running sets of tests in IDEs. - // Gradle will run each test class, so we exclude the suites to avoid redundantly running the tests twice. - exclude '**/*Suite.class' + exclude testsToExclude if (shouldUseJUnit5) useJUnitPlatform() @@ -395,9 +416,7 @@ subprojects { } logTestStdout.rehydrate(delegate, owner, this)() - // The suites are for running sets of tests in IDEs. - // Gradle will run each test class, so we exclude the suites to avoid redundantly running the tests twice. - exclude '**/*Suite.class' + exclude testsToExclude if (shouldUseJUnit5) { useJUnitPlatform { @@ -429,9 +448,7 @@ subprojects { } logTestStdout.rehydrate(delegate, owner, this)() - // The suites are for running sets of tests in IDEs. - // Gradle will run each test class, so we exclude the suites to avoid redundantly running the tests twice. - exclude '**/*Suite.class' + exclude testsToExclude if (shouldUseJUnit5) { useJUnitPlatform { diff --git a/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java b/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java index 44187134225..f9a64f6fdb6 100644 --- a/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java +++ b/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java @@ -36,6 +36,8 @@ import org.apache.kafka.common.utils.Utils; import org.apache.kafka.test.TestSslUtils; import org.apache.kafka.test.TestUtils; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.condition.DisabledOnJre; +import org.junit.jupiter.api.condition.JRE; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -591,7 +593,7 @@ public class SslTransportLayerTest { } /** - * Tests that connection success with the default TLS version. + * Tests that connection succeeds with the default TLS version. */ @ParameterizedTest @ArgumentsSource(SslTransportLayerArgumentsProvider.class) @@ -611,12 +613,6 @@ public class SslTransportLayerTest { NetworkTestUtils.checkClientConnection(selector, "0", 10, 100); server.verifyAuthenticationMetrics(1, 0); selector.close(); - - checkAuthenticationFailed(args, "1", "TLSv1.1"); - server.verifyAuthenticationMetrics(1, 1); - - checkAuthenticationFailed(args, "2", "TLSv1"); - server.verifyAuthenticationMetrics(1, 2); } /** Checks connection failed using the specified {@code tlsVersion}. */ @@ -636,12 +632,15 @@ public class SslTransportLayerTest { */ @ParameterizedTest @ArgumentsSource(SslTransportLayerArgumentsProvider.class) - public void testUnsupportedTLSVersion(Args args) throws Exception { - args.sslServerConfigs.put(SslConfigs.SSL_ENABLED_PROTOCOLS_CONFIG, Arrays.asList("TLSv1.2")); + @DisabledOnJre(JRE.JAVA_16) + public void testUnsupportedTlsVersion(Args args) throws Exception { server = createEchoServer(args, SecurityProtocol.SSL); checkAuthenticationFailed(args, "0", "TLSv1.1"); server.verifyAuthenticationMetrics(0, 1); + + checkAuthenticationFailed(args, "0", "TLSv1"); + server.verifyAuthenticationMetrics(0, 2); } /**