-
Notifications
You must be signed in to change notification settings - Fork 69
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
Gradle use locks extensively when native agent is used #655
Comments
You should be very careful when interpreting locks in Gradle. It's basically locks waiting for the test task to finish. The fact of using the agent will not have any influence on how Gradle uses locks or not. However, the agent may be responsible for slower tests. |
So if the agent itself isn't causing the issue, could it be that using the agent extends the test execution time enough that more locks are being acquired? |
That's what I would think, yes. |
In some particular cases the agent can be up to 10x slower than the original execution. @kgonia would it be possible to pinpoint which test is causing this so we can try to optimize it? |
In general, I noticed this during Spring tests. My guess is that it’s related to proxies, especially CGLIB proxies, but that's a very rough assumption. I can try to distill more concrete clues. |
Also, is this with conditional metadata collection or just the regular run? |
I'm using conditional metadata collection. In the project I tried to run, it takes over 1 hour with the agent versus 4 minutes without it. It’s around 120 integration tests using MockMvc. I also tried my configuration with spring-petclinic, but the differences here are much smaller:
|
Thanks for all the details. This ticket better fits the GraalVM issue tracker. Could you please re-open it there and we will have a look if this can be optimized? CC @DSouzaM |
Sure, Here is the ticket oracle/graal#10352 |
Thank you, we can continue with further discussion and the fixes there. |
Hi, I also reported this on gradle - gradle/gradle#31668 but I was suggested to create issues also here as source of this is unknown and might be gradle issue or native plugin.
Describe the bug
When I run tests with -Pagent option gradle use far more locks than without it. As result tests are running much longer (minutes vs hours)
with my projects it's 68 vs 1097
To Reproduce
I've created simple project but it didn't fully show the problem as it has small test base. However with this project agent lock is acquired 1 time, with agent 3 times
https://github.com/[kgonia/gradle-native-locks-demo](https://github.com/kgonia/gradle-native-locks-demo
Expected behavior
Collecting reachability data during tests should execute in similar time as without it.
Logs
System Info (please complete the following information):
On Windows and WSL it behaves similar
OS: Windows
GraalVM Version: GraalVM 22.3.1 Java 19 C
Java Version: 19.0.2+7-jvmci-22.3-b12
Plugin version 10.0.3
OS: WSL
GraalVM Version: CE 23.0.1+11.1
Java Version: 23.0.1
Plugin version 10.0.3
Additional context
After investigation I thought cause of the problems is test sources generation as it triggers gradle file watcher and then daemon locks all checked but running with --no-watch-fs didn't change much.
The text was updated successfully, but these errors were encountered: