You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the smallest, simplest way to reproduce the problem?
Run the above project files on Gradle 8.12.1 and Java 21 (I suspect other versions of Gradle and Java work, too). Use the command ./gradlew check.
What did you expect to see?
The tasks test, integrationTest and rewriteDryRun should run in parallel.
If I configure check to just depend on test and integrationTest, it takes just over 1 second to run because each task takes 1 second to run and the configuration cache lets them run in parallel. For example:
Expected logs
$ ./gradlew check
Calculating task graph as no cached configuration is available for tasks: check
> Task :test
Running unit tests...
Unit tests succeeded
> Task :integrationTest
Running integration tests...
Integration tests succeeded
BUILD SUCCESSFUL in 1s
2 actionable tasks: 2 executed
Configuration cache entry stored.
What did you see instead?
When running check as above (depending on test, integrationTest and rewriteDryRun), the tasks run sequentially and configuration cache problems are reported, like so:
Actual logs
$ ./gradlew check
Calculating task graph as configuration cache cannot be reused because file 'build.gradle.kts' has changed.
> Task :integrationTest
Running integration tests...
Integration tests succeeded
> Task :rewriteDryRun
No recipes were activated. Activate a recipe with rewrite.activeRecipe("com.fully.qualified.RecipeClassName") in your build file, or on the command line with -DactiveRecipe=com.fully.qualified.RecipeClassName
Applying recipes would make no changes. No report generated.
> Task :test
Running unit tests...
Unit tests succeeded
2 problems were found storing the configuration cache.
- Task `:rewriteDryRun` of type `org.openrewrite.gradle.RewriteDryRunTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.12.1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:rewriteDryRun` of type `org.openrewrite.gradle.RewriteDryRunTask`: invocation of 'Task.project' at execution time is unsupported.
See https://docs.gradle.org/8.12.1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
See the complete report at file:///Users/jonathan.bluett-dunc/dev/openrewrite-gradle-plugin-configuration-cache-reproducer/build/reports/configuration-cache/9yj95qyh2pztrmbx6nutad2pr/ddgoq81bh219dx2b3f22zgeb6/configuration-cache-report.html
[Incubating] Problems report is available at: file:///Users/jonathan.bluett-dunc/dev/openrewrite-gradle-plugin-configuration-cache-reproducer/build/reports/problems/problems-report.html
BUILD SUCCESSFUL in 5s
3 actionable tasks: 3 executed
Configuration cache entry discarded with 2 problems.
What is the full stack trace of any errors you encountered?
No stack trace is reported when running ./gradlew check --stacktrace.
What version of OpenRewrite are you using?
I am using
No recipes are necessary to reproduce this issue.
How are you running OpenRewrite?
I am using the Gradle plugin, and my project is a single module project.
My minimal reproducer comprises of these files.
build.gradle.kts
gradle.properties
org.gradle.configuration-cache=true
settings.gradle.kts
What is the smallest, simplest way to reproduce the problem?
Run the above project files on Gradle 8.12.1 and Java 21 (I suspect other versions of Gradle and Java work, too). Use the command
./gradlew check
.What did you expect to see?
The tasks
test
,integrationTest
andrewriteDryRun
should run in parallel.If I configure
check
to just depend ontest
andintegrationTest
, it takes just over 1 second to run because each task takes 1 second to run and the configuration cache lets them run in parallel. For example:Expected logs
What did you see instead?
When running
check
as above (depending ontest
,integrationTest
andrewriteDryRun
), the tasks run sequentially and configuration cache problems are reported, like so:Actual logs
What is the full stack trace of any errors you encountered?
No stack trace is reported when running
./gradlew check --stacktrace
.Are you interested in contributing a fix to OpenRewrite?
I'm not sure if I'll have time, but if so, then yes I'd love to!
The text was updated successfully, but these errors were encountered: