apache / camel-quarkus

Apache Camel Quarkus
https://camel.apache.org
Apache License 2.0
256 stars 189 forks source link

Investigate KafkaDevServicesDisabledTest failure test #3206

Closed zhfeng closed 2 years ago

zhfeng commented 3 years ago

Currently if KafkaDevServicesDisabledTest is running after KafkaDevServicesEabledTest, it is failing with

[ERROR] camelKafkaComponentBrokersConfigurationNull  Time elapsed: 0.014 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <null> but was: <PLAINTEXT://localhost:33066>

It looks like the kafka dev service is avaible during all the test phase regardless of the test is restarted even if quarkus.kafka.devservices.enabled=false is configed.

It might be a bug somewhere in Quarkus DevService.

zhfeng commented 3 years ago

The DevServicesConfigBuildItem property looks like be merged from the previous runs, refer to https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/steps/DevServicesConfigBuildStep.java#L34-L48

So it should to produce RunTimeConfigurationDefaultBuildItem instead of DevServicesConfigBuildItem for camel.component.kafka.brokres

aldettinger commented 3 years ago

So, we are in the case where dev services were enabled (default value) and then explicitly disabled. But then Quarkus passes /merges the previous broker url from old generation to the new one. Is my understanding correct at this stage ?

If yes, then isn't it a Quarkus bug ?

zhfeng commented 2 years ago

@aldettinger yeah, you're correct. I'm not sure this is a bug or a design feature. It could be worth to open a Quarkus issue to get some explains.

zhfeng commented 2 years ago

https://groups.google.com/g/quarkus-dev/c/VrFfMT6d7qc

aldettinger commented 2 years ago

@zhfeng From quarkus-dev discussion, it looks there are more investigation. Should we re-open this ticket then ? Or maybe have a follow up issue ?

zhfeng commented 2 years ago

@aldettinger yeah, I'm testing with Stuart's fix. And creat a follow up issue if the fix works.

zhfeng commented 2 years ago

The upstream Quarkus https://github.com/quarkusio/quarkus/pull/20964 can fix the failure tests. The following https://github.com/apache/camel-quarkus/issues/3227 will be fixed in quarkus-main.