definedTests
taking a long time, possibly because of internalDependencyClasspath
#7512
-
sbt version: 1.9.2 I'm trying to diagnose around 25 seconds of latency between running Do you agree with my diagnosis? Is there something I can do to lower the time taken by |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Most of sbt's default tasks are defined in one file called definedTests := detectTests.value,
....
def detectTests: Initialize[Task[Seq[TestDefinition]]] =
Def.task {
Tests.discover(loadedTestFrameworks.value.values.toList, compile.value, streams.value.log)._1
} so if If you call |
Beta Was this translation helpful? Give feedback.
-
Unfortunately I cannot answer anymore (trying to figure out why this was taking a long time was my last contribution to a codebase I no longer have access to) but I shared this post with my former colleagues, I hope they can follow up on this. Thank you for your help! |
Beta Was this translation helpful? Give feedback.
-
Hi @eed3si9n, It seems to me that the Tests.discover() call is getting slow for some reason. The Test/compile does not finish very quickly, and it triggers the definedTests as well, so it is the same essentially (is this normal?)
and then Test/compile then took less than a second. I also turned on What could cause this slow-down? |
Beta Was this translation helpful? Give feedback.
-
Is it normal that this information (the discovered tests) is not cached? (this is executing each and every time with no code changes whatsoever) |
Beta Was this translation helpful? Give feedback.
-
Oh I figured out: it is the sbt-jupiter-interface plugin 🎉 I wanted to narrow down what is expensive in that call, so I spelled out the default Tests.discover there, and to my big surprise all the waits disappeared. |
Beta Was this translation helpful? Give feedback.
Oh I figured out: it is the sbt-jupiter-interface plugin 🎉
I wanted to narrow down what is expensive in that call, so I spelled out the default Tests.discover there, and to my big surprise all the waits disappeared.
Then I was looking for things which override the definedTests, and voila.
The problem in our build was that that plugin is by default activated on all subprojects, and since the definedTests task results are not cached, recursively executes to all subprojects, it causes quite some wait times.
Do you know maybe how to turn around the black-list approach with auto-plugins to a white-list approach? (using the auto plugin but not letting it automatically active in all projects, ju…