[ZEPPELIN-6639] Migrate Cassandra interpreter tests to Testcontainers with Cassandra 4.x - #5412
Merged
Merged
Conversation
Cassandra 3.x crashes on JDK 17 because Unsafe.objectFieldOffset() on hidden classes (lambdas) throws UnsupportedOperationException during PREPARE statement storage. This is a hard JVM restriction no flag can override. Cassandra 4.x handles this correctly. - Replace cassandra-unit with Testcontainers cassandra:4.1.3 - Rewrite CassandraInterpreterTest to use CassandraContainer - Update test expectation HTML files for Cassandra 4.x table options - Normalize localhost/<unresolved> InetSocketAddress format in assertions (JDK 17+ renders unresolved addresses differently) Assisted-by: GLM 5.2
Member
|
Merged into master (4728b91). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR for?
The Cassandra interpreter tests use
cassandra-unitwhich embeds Cassandra 3.11.5 in-process. Cassandra 3.x is EOL (unmaintained, archived) and crashes on JDK 17 becauseUnsafe.objectFieldOffset()on hidden classes (lambdas) throwsUnsupportedOperationExceptionduringPREPAREstatement storage -- a hard JVM restriction no flag can override. This PR migrates the tests to Testcontainers with Cassandra 4.1.3 (the latest maintained 4.1.x), which handles JDK 17 correctly. This is a prerequisite for JDK 17 support.What type of PR is it?
Improvement
What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-6639
How should this be tested?
cassandramodule: 39 tests pass on JDK 11 and JDK 17 with Docker./mvnw test -pl cassandraQuestions
Details
cassandra-unitdependency withorg.testcontainers:cassandra(cassandra:4.1.3image)org.testcontainers:cassandrato rootpom.xmldependencyManagementCassandraInterpreterTestto useCassandraContainerinstead ofEmbeddedCassandraServerHelperCqlSessioninstead ofCQLDataLoaderadditional_write_policy = '99p'(new in 4.x)read_repair = 'BLOCKING'(replacesdclocal_read_repair_chance+read_repair_chance)speculative_retry = '99p'(replaces'99PERCENTILE')compression chunk_length_in_kb = 16(was 64)NoResultWithExecutionInfo.html: replace hardcodedlocalhost:9142withTRIED_HOSTS/QUERIED_HOSTSplaceholderslocalhost/<unresolved>:portin test assertions (JDK 17+InetSocketAddress.toString()renders unresolved addresses differently)Assisted-by: GLM 5.2