My issue is that it runs tests that can't be affected by the changes you
made. For example, a change in the media module will run the tests of base,
graphics, and controls, even though these are not aware of media sources
(save 'exports to' in module-info).

I think that there are two scenarios that ended up being combined here. The
one mentioned in the issue is rerunning tests that pass; this is valid in
non-deterministic tests. The other one is what I wrote above where tests
that can't be affected are rerun; this is never valid.

I'll see if there's a way to separate these scenarios. Defaulting
FORCE_TESTS to true and wiring it to the test task configuration can also
work, maybe as a last resort.

On Tue, Aug 4, 2026 at 5:48 PM Kevin Rushforth <[email protected]>
wrote:

> This was intentionally done via the following:
>
> JDK-8307076: gradle test should always run tests [1][2]
>
> I see that I forgot to remove the unused FORCE_TESTS property.
>
> I am very much in favor of always running tests, at least by default, as
> I said in the bug and PR. I would oppose changing the default for those
> same reasons. As I mentioned there, gradle's test harness is the only UI
> test framework I've used where the "run tests" command doesn't
> unconditionally run tests.
>
> If you want to retain the ability to run only if gradle thinks you need
> to, then I wouldn't oppose the idea of qualifying it with "FORCE_TESTS"
> as long as the default was changed to true, matching today's behavior.
>
> -- Kevin
>
> [1] https://bugs.openjdk.org/browse/JDK-8307076
> [2] https://github.com/openjdk/jfx/pull/1120
>
> On 8/4/2026 4:24 AM, Nir Lisker wrote:
> > Hi all,
> >
> > The Gradle build defines:
> >
> > defineProperty("FORCE_TESTS", "false")
> > ext.IS_FORCE_TESTS = Boolean.parseBoolean(FORCE_TESTS);
> >
> > However, it's never used. Meanwhile, the allprojects configuration for
> the
> > 'test' task declares:
> >
> > // Always run tests
> > outputs.upToDateWhen { false }
> >
> > It's not clear why all tests need to be run every time. I suspect that
> the
> > line should be
> >
> > outputs.upToDateWhen { IS_FORCE_TESTS }
> >
> > This can save a lot of time during development iterations as there's no
> > reason to run unaffected tests.
> >
> > Are there any insights into this?
> >
> > - Nir
>
>

Reply via email to