Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Testcontainers 1.20.2 #42670

Closed
snicoll opened this issue Oct 14, 2024 · 4 comments
Closed

Upgrade to Testcontainers 1.20.2 #42670

snicoll opened this issue Oct 14, 2024 · 4 comments
Assignees
Labels
status: superseded An issue that has been superseded by another type: task A general task
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Oct 14, 2024

No description provided.

@snicoll snicoll added the type: dependency-upgrade A dependency upgrade label Oct 14, 2024
@snicoll snicoll added this to the 3.4.0-RC1 milestone Oct 14, 2024
@snicoll snicoll reopened this Oct 15, 2024
@snicoll
Copy link
Member Author

snicoll commented Oct 15, 2024

Unfortunately, the upgrade missed several key points. Cassandra and Kafka containers have moved with a deprecation, but they don't share any common ancestors. As a result, if we move our support to the non-deprecated version, then the deprecated version no longer works (i.e. ConnectionDetails aren't provided anymore).

The other problem is that the difference between the deprecated CassandraContainer and non-deprecated one is sufficient for breaking our SSL smoke tests. We'll have to figure out why the container is failing in the background with the following exception:

INFO  [nioEventLoopGroup-2-7] 2024-10-15 10:55:28,562 Message.java:826 - Unexpected exception during request; channel = [id: 0xa3393c93, L:0.0.0.0/0.0.0.0:9042 ! R:/127.0.0.1:41786]
io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 0400000001000000160001000b43514c5f56455253494f4e0005332e302e30
    at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1057) ~[netty-all-4.0.44.Final.jar:4.0.44.Final]
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411) [netty-all-4.0.44.Final.jar:4.0.44.Final]

cc @eddumelendez for visibility.

@eddumelendez
Copy link
Contributor

Hi @snicoll, thanks for sharing. I have raised testcontainers/testcontainers-java#9410

Thanks for adapting the project to support the new implementations and sorry for the unexpected issues.

@snicoll
Copy link
Member Author

snicoll commented Oct 16, 2024

Thanks Eddu. FTR Kafka also has unexpected issues. The new container implementation doesn't behave the same way. So it looks like users have to use the deprecated version initially and then look at the differences.

I wonder if the Javadoc of the deprecated containers could be adapted. I can create an issue if you prefer?

@eddumelendez
Copy link
Contributor

Kafka is a little bit different. org.testcontainers.containers.KafkaContainer has three modes to start (embedded zookeeper, external zookeeper and raft or zookeeperless) and the default one is embedded zookeeper. ConfluentKafkaContainer is not a full replacement of the previous one, it just supports raft mode which starts with tag 7.4.0. The smoke test for SSL was using the embedded zookeeper but could switch to kraft mode using withKraft() and then the same change would be required as using ConfluentKafkaContainer. Also, the new implementation use the standard kafka port 9092 and remove the security protocol from bootstrap-server, indeed now you can use kafka::getBootstrapServers instead, I remember there is or was an issue related to testcontainers providing plaintext as part of the bootstrap server in boot but couldn't find it.

Testcontainers Kafka documentation mentions the minimum version to use with Confluent but the javadoc miss it. I will update this.

As always your feedback is very welcome.

@snicoll snicoll added type: task A general task status: superseded An issue that has been superseded by another and removed type: dependency-upgrade A dependency upgrade labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another type: task A general task
Projects
None yet
Development

No branches or pull requests

3 participants