essobedo commented on PR #5035:
URL: https://github.com/apache/camel-quarkus/pull/5035#issuecomment-1614346218

   @ppalaga I've just checked and refreshed my mind a bit about it, the problem 
here is very specific and complex, it only occurs when using the Quarkus JUnit5 
extension with Groovy extensions. The Groovy extensions are loaded with the 
System ClassLoader instead of the `Quarkus Runtime ClassLoader` because Groovy 
[is declared as a parent first artifact in Quarkus 
core](https://github.com/quarkusio/quarkus/blob/main/core/runtime/pom.xml#L195-L197)
 that is why the Camel extensions are not seen. Groovy has been declared as a 
parent's first artifact to fix a ClassValue leak in Quarkus described in [this 
ticket](https://github.com/quarkusio/quarkus/issues/12498). In theory, the way 
to fix the leak is more or less what is done in the 
[`GroovyCacheCleaner`](https://github.com/quarkusio/quarkus/blob/main/test-framework/common/src/main/java/io/quarkus/test/common/GroovyCacheCleaner.java)
 in case Groovy is in the System CL but if Groovy is in a custom CL like 
`Quarkus Runtime ClassLoader` it g
 ets even more complex to clean up the `ClassValue` so I'm testing another 
approach that simply disables the `ClassValue` in Groovy if the tests pass I 
will propose the ticket and the corresponding PR hoping that they will accept 
them otherwise I'm afraid that the only way is to keep the code as it is in 
camel-quarkus and apply your proposal in Quarkus Plarform. I don't think it is 
worth too much effort since once again it is a very specific use case and 
having Groovy classes loaded in the `Quarkus Runtime ClassLoader` may have an 
impact on the duration of the tests since it will load potentially several 
times the Groovy classes per module instead of only once.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to