Closed loicmathieu closed 1 month ago
/cc @geoand, @stuartwdouglas
It only occurs when both devservices and Kafka companion is used and kafka.bootstrap.servers
is set, in this case normal Kafka devservices is not started by default as the props is set by Kafka test companion start one.
So, I'm not sure it's a bug per se ;)
If I unset kafka.bootstrap.servers
Docker is setuped once a redpanda container starts that is not compatible with the Kafka Companion or the schema registry ...
Configuring devservices to quarkus.kafka.devservices.image-name=quay.io/strimzi-test-container/test-container:0.100.0-kafka-3.1.0
solves it.
So it raises multiple questions:
kafka.bootstrap.server
options ?I need to check but KafkaCompanionResource
did verify if kafka.bootstrap.servers
is set on devservices context.
I think, the fact that you are seeing ryuk twice means test containers was init from multiple classpath (build and tests ?)
I'll investigate this.
I believe this is fixed by #28702. @loicmathieu can you verify it again?
@ozangunalp no, I can still saw Ruyk started twice when using the Kafka Companion using Quarkus 2.13.4.
Hello,
I experienced this issue too, it took me a while to understand what was going on and if my test failures were due to the fact that multiple Kafka instances were started or not.
Here's a simple reproducer based on Quarkus Kafka starter code : https://github.com/GauthierHacout/quarkus_test_kafka (There's a single test and it showcases the behavior)
2023-09-20 15:38:30,154 INFO [tc.tes.5.1] (build-11) Container testcontainers/ryuk:0.5.1 is starting: 1aa4841619e5f345bf75c48b34334b4334cfb20a51a445a5b1ad21b2da841284
2023-09-20 15:38:30,613 INFO [tc.doc.io/.3.4] (build-17) Container docker.io/vectorized/redpanda:v22.3.4 is starting: 83f7c375f6631cda758466469cbef1cee1589361534c0b516667d55e28a2c9f8
Maybe even more bizarre, when I add the config quarkus.kafka.devservices.enabled=false
inside my application.properties I end up with not 2 but 3 Kafka instances started in test.
My test still works though, but it's quite distracting when looking for reason of test failures ! I hope this can help to investigate the issue.
I used Quarkus 3.3.2 btw
Having 2 instances of dev services during dev mode is normal as test execution creates their own devservice instances. When dev services are disabled the KafkaCompanionResource
starts its own Kafka broker. Maybe that's what you are seeing.
But these are not related to the original issue.
I updated the reproducer to the latest version and couldn't see the issue (might be Windows-specific though).
If it's still a problem, please reopen it with a bit more information on how to reproduce it.
Describe the bug
When using multiple devservices: Kafka via the Kafka Companion test extension and Apicurio Service Registry, Ryuk is started twice and the Dockerfactory is initialized twice. Everything works but it make the test a bit longuer that necessary.
See the following log:
Expected behavior
Ryuk and the Dockerfactory are only started once.
Actual behavior
No response
How to Reproduce?
Reproducer is here: multiple-dev-services.zip
Output of
uname -a
orver
Microsoft Windows [version 10.0.19044.1826]
Output of
java -version
openjdk version "18" 2022-03-22
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.11.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Additional information
No response