Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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')
Expand All @@ -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'
}
}
}
Expand Down
35 changes: 26 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
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;
Expand Down Expand Up @@ -591,7 +593,7 @@ public void testInvalidKeyPassword(Args args) throws Exception {
}

/**
* Tests that connection success with the default TLS version.
* Tests that connection succeeds with the default TLS version.
*/
@ParameterizedTest
@ArgumentsSource(SslTransportLayerArgumentsProvider.class)
Expand All @@ -611,12 +613,6 @@ public void testTlsDefaults(Args args) throws Exception {
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}. */
Expand All @@ -636,12 +632,15 @@ private void checkAuthenticationFailed(Args args, String node, String tlsVersion
*/
@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);
}

/**
Expand Down