-
Notifications
You must be signed in to change notification settings - Fork 66
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
SQL annotations didn't work anymore with Quarkus starting with 1.3 #72
Comments
I have a better understanding on what's going on here. Quarkus uses Vert.x and all I/O are done via a worker thread. So we cannot use a So we need to find a way to store the |
Thanks for these explanations. Tests may be executed in parallel. They have to be independent of each other. The thread local implementation allows this when these tests are executed in only one JVM and when the thread executing the test methods also calls the datasource. When the test method and the datasource are called from different threads, the thread local implementation cannot work. When a test is executed in a specific JVM, and so isolated from the other tests, the implementation does not use a thread local (see SqlRecorderRegistry). This is why, in quickperf-examples, the test methods of Spring RET controllers use the @heapsize annotation.
I don't think it could work without adding code instrumenation on frameworks (Spring, Quarkus, ...). I don't prefer to do that. Could you please test by adding @heapsize on Quarkus tests? |
I can't as forking the VM didn't work for Quarkus because we fork too late. I think supporting tests in parallel is less important than supporting all the major microservice frameworks. |
Could you please provide a project example reproducing the problem? Thanks |
With Quarkus 1.3 and a JVM annotation, I got an To have Quarkus JUnit 5 extension executed only in the JVM where the test method is executed, I wanted to test the following solution: @RegisterExtension
Extension quarkusTestExtension = buildQuarkusExtensionInNewJVM()
private Extension buildQuarkusExtensionInNewJVM() {
if(SystemProperties.TEST_CODE_EXECUTING_IN_NEW_JVM.evaluate()) {
return new QuarkusTestExtension();
}
return new Extension() {}; // Extension doing nothing
}
@RegisterExtension
QuickPerfTestExtension quickPerfTestExtension = new QuickPerfTestExtension(); However, the following Quarkus code without QuickPerf code does not work @RegisterExtension
Extension quarkusTestExtension = new QuarkusTestExtension();
The example is here. |
@jeanbisutti as
See for details Static Fields section of the dcumentation: https://junit.org/junit5/docs/5.1.1/api/org/junit/jupiter/api/extension/RegisterExtension.html |
@loicmathieu, thanks The example is updated with a static field. However, with this modification,
As you kwow well Quarkus could you please have a look? |
@jeanbisutti can you try with Quarkus 1.7.0 ? |
So you need to defines the annotation as a static attribute and upgrade to 1.7.0.Final:
Then we're facing a new issue: Quarkus register the test classes as a CDI bean to be able to make injection inside it. |
It's a tricky issue, we must register the extension with the |
It's better with Quarkus 1.7 and QuarkusTestExtension . I quickly add new code in this project to have Quarkus and QuickPerf extensions working together. It does not work yet. I imagine that things should be adjusted in QuarkusTestExtensionDoingNothing class. In the following days, I will not have the time to look more in-depth. Don't hesitate to work on the implementation if you like. |
I was trying exactly the same a few hours ago ;) and didn't succeed either. |
Hi @loicmathieu, |
@malys unfortunatly no, the reactive nature of Quarkus and it's specific classloader made it very difficult for quickperf to works on it. I tried multiple things without success. |
What a shame! because Quick-perf seems very interesting. Do you know any alternative compatible with Quarkus? performance test oriented regression detection |
@malys you can ping me on twitter or via email to discuss this subject but I still keep this issue on my todo list and I hope I will find a way to make Quickperf working with Quarkus as I'm a contributor to both project that are both awesome ! |
Hi @loicmathieu , any updates/alternatives so far?
|
@coiouhkc no update so far, Quarkus has its own classloader and this causes challenge to integrate it with Quickperf. |
@jcunliffe1 this is a little more complex, the datasource is created in a different classloader than when the SQL queries are exectuted so the way we register the profile information didn't work. I currently don't have time to think of a different way to do it. |
bummer, your library is awesome - would have loved to get it included. |
Describe the bug
SQL annotations didn't work with Quarkus starting with 1.3.
No issues are detected.
I chased down the issue to
SqlRecorderRegistry
that uses anInheritableThreadLocal
to stores theSqlRecorder
.Starting with Quarkus 1.3, when inside the
DataSourceQuickPerfListener
the list of sql recorders is empty?I'm not sure if it's due to the changes in Classloader inside Quarkus or the fact that it is now run on Vert.X for all wordload (so possibly on a separate thread).
To Reproduce
Update the Quarkus example application of Quickperf to use Quarkus 1.3.0.Final.
Versions
Additional context (Add any other context about the problem here.)
The text was updated successfully, but these errors were encountered: