JDK-8166662 : Gradle test takes more time when skipping sdk
  • Type: Bug
  • Component: javafx
  • Sub-Component: build
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-09-25
  • Updated: 2022-11-15
  • Resolved: 2016-10-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Relates :  
Description
After the JDK-8165809 fix, there are more tasks which needs to be skipped when running with BUILD_SDK_FOR_TEST=true.
Apparently, the build takes longer with the skipping than without.
Specifically, it always do :graphics:compileJslcJava and :graphics:compileFullJava.
Comments
Changeset: caf945fed1c0 Author: vadim Date: 2016-09-25 14:45 +0300 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/caf945fed1c0
06-10-2016

+1
05-10-2016

Looks fine to me (but make sure Dave is OK with it too). +1
05-10-2016

Actually quoting TaskExecutionGraph javadoc 'The TaskExecutionGraph is populated only after all the projects in the build have been evaulated.'. If I add println task to the filter, it prints all the tasks. Also this filter will be effective only for test tasks because for some reason many tasks depend on the build/sdk/lib/jfxrt.jar
05-10-2016

Your webrev is on the right track, but I wonder if the change is in the right spot. Gradle evaluates stuff in a linear fashion on the first pass, and so any tasks that are created later in the script (which would be all of the non-default tasks) would not be affected by your change. So I think I am in favor of the change, but think it should likely be below any of the project definitions, likely after the allprojects that you removed some stuff out of, or before the task clean() { Note that there might be no difference with the stuff you are turning off now, this would be primarily to avoid people wondering later why they can't disable an extra task or three.
05-10-2016

I've noticed that I've mixed the value for BUILD_SDK_FOR_TEST, it should be 'false' in above comments. Interesting thing is that running default test tasks actually results in recompiling and rerunning all tests due to the fact that jfxrt.jar has changed. I wonder if something can be done here (or for modular build since jfxrt.jar will be gone soon) So the only useful usage for upToDateWhen right now is running with BUILD_SDK_FOR_TEST=false. And in this case unconditionally recompile all tests are actually bad because as you said gradle recompiles and rerun only changed tests which is a reasonable default behavior for quick turnaround time. I could probably add a parameter but definitely not in this bug.
26-09-2016

@Vadim: We looked setting 'upToDateWhen { false }' back when switching to gradle (see JDK-8098173), but decided not to do it at that time. However, I think this would be a good change, and can't think of a good reason not to do it.
26-09-2016

Moreover, running with BUILD_SDK_FOR_TEST=true doesn't allow running without some already built bits. This happens because disabling a task doesn't disable its dependencies. So here's the fix which will filter the task execution graph and remove all "classes" and "jar" tasks. This greatly speeds up running a single test and allows to run a test without building sdk. http://cr.openjdk.java.net/~vadim/8166662/webrev.00/ BTW, I'm also thinking about adding outputs.upToDateWhen { false } to the tests tasks. This will enable re-running even up-to-date tests.
25-09-2016