RFR: 8348423: [TestBug] stress test Nodes initialization from a background thread [v2]

Andy Goryachev angorya at openjdk.org
Fri Jan 31 23:06:49 UTC 2025


On Fri, 31 Jan 2025 21:39:12 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> tests/system/src/test/java/test/robot/javafx/scene/NodeInitializationBackgroundThreadTest.java line 732:
>> 
>>> 730:     private <T extends Node> void test(Supplier<T> generator, Consumer<T> operation) {
>>> 731:         AtomicReference<T> ref = new AtomicReference();
>>> 732:         runAndWait(() -> {
>> 
>> What was the rationale for this change? This means we are no longer testing the ability to construct a node off thread.
>> 
>> Related to this, I think a separate set of tests where we construct instances of the node in a loop would be useful, in addition to the set of tests that mutates the node in a loop.
>
> I think this change is why the Tooltip test is no longer failing. The failure mode reported in [JDK-8348100](https://bugs.openjdk.org/browse/JDK-8348100) happens when  constructing Tooltip on a background thread.

The very first (visible) node should be created in the FX application thread (something I missed earlier).  All other instances are created in the background thread - notice the second call to `generator.get()` inside the background thread lambda.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1690#discussion_r1938072166


More information about the openjfx-dev mailing list