On Sat, 7 Feb 2026 01:36:20 GMT, Michael Strauß <[email protected]> wrote:

>> `test.robot.javafx.scene.TooltipTest` modifies the scene graph on a test 
>> worker thread, which can corrupt the scene graph and leads to test failures 
>> such as:
>> 
>> 
>> TooltipTest > testCssStylesheetChangeTooltip() FAILED
>>     java.lang.AssertionError
>>         at 
>> [javafx.graphics@27-ea](mailto:javafx.graphics@27-ea)/com.sun.javafx.css.StyleMap.getCascadingStyles(StyleMap.java:144)
>>         at 
>> [javafx.graphics@27-ea](mailto:javafx.graphics@27-ea)/javafx.scene.CssStyleHelper.resetToInitialValues(CssStyleHelper.java:490)
>>         at 
>> [javafx.graphics@27-ea](mailto:javafx.graphics@27-ea)/javafx.scene.CssStyleHelper.createStyleHelper(CssStyleHelper.java:193)
>>         at 
>> [javafx.graphics@27-ea](mailto:javafx.graphics@27-ea)/javafx.scene.Node.reapplyCss(Node.java:9996)
>>         at 
>> [javafx.graphics@27-ea](mailto:javafx.graphics@27-ea)/javafx.scene.Node.reapplyCSS(Node.java:9959)
>>         at 
>> [javafx.graphics@27-ea](mailto:javafx.graphics@27-ea)/javafx.scene.Scene$10.onChanged(Scene.java:1682)
>>         at 
>> [javafx.base@27-ea](mailto:javafx.base@27-ea)/com.sun.javafx.collections.TrackableObservableList.lambda$new$0(TrackableObservableList.java:44)
>>         at 
>> [javafx.base@27-ea](mailto:javafx.base@27-ea)/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:162)
>>         at 
>> [javafx.base@27-ea](mailto:javafx.base@27-ea)/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:71)
>>         at 
>> [javafx.base@27-ea](mailto:javafx.base@27-ea)/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:246)
>>         at 
>> [javafx.base@27-ea](mailto:javafx.base@27-ea)/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
>>         at 
>> [javafx.base@27-ea](mailto:javafx.base@27-ea)/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
>> 
>> 
>> or
>> 
>> 
>> TooltipTest > testCssStylesheetChangeTooltip() STANDARD_ERROR
>>     Exception in thread "JavaFX Application Thread" 
>> java.lang.NullPointerException: Cannot invoke "java.util.List.clear()" 
>> because "this.selectors" is null
>>         at 
>> [javafx.graphics@27-internal](mailto:javafx.graphics@27-internal)/com.sun.javafx.css.StyleMap.getCascadingStyles(StyleMap.java:148)
>>         at 
>> [javafx.graphics@27-internal](mailto:javafx.graphics@27-internal)/javafx.scene.CssStyleHelper.resetToInitialValues(CssStyleHelper.java:490)
>>         at [javafx.graphics@27-internal](mailto:javafx.graphics@27-interna...
>
> Michael Strauß has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   increase DELTA to 150

Since I wrote the test, I can confirm this fix looks good. 

Back then, it worked for me (as it did until recently), so I did not consider 
modifying the stylesheet on another thread is a problem. But makes sense.

> TooltipTest > testShowDelayCssShowTooltipTwice() FAILED
    org.opentest4j.AssertionFailedError: 204 <= 200 ==> expected: <true> but 
was: <false>

I think we had this kind of problem at least once in the past.
It should be safe to increase the delta a bit more, since we are far away from 
the default timing.
(That was the problem back then. You set a show delay of 100ms, but it still 
used the default 1000ms. So the delta should not be that big as otherwise we 
will not catch this regression. But we are far away from that).

Marked as reviewed by mhanl (Committer).

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

Marked as reviewed by mhanl (Committer).

PR Review: https://git.openjdk.org/jfx/pull/2066#pullrequestreview-3763912600
PR Review: https://git.openjdk.org/jfx/pull/2066#pullrequestreview-3765069085

Reply via email to