JDK-8255080 : SwingNodeJDialogTest fails to match exact color on some macOS systems
  • Type: Bug
  • Component: javafx
  • Sub-Component: swing
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2020-10-20
  • Updated: 2024-02-07
  • Resolved: 2022-02-07
Related Reports
Relates :  
Relates :  
Description
I get the following test failure consistently on a relatively new MacBook Pro system (early 2020 model), running macOS 10.15.7.

SwingNodeJDialogTest

test.robot.javafx.embed.swing.SwingNodeJDialogTest > testJDialogAbove FAILED
    java.lang.AssertionError: JDialog is not above JavaFX stage expected:<java.awt.Color[r=0,g=0,b=255]> but was:<java.awt.Color[r=20,g=0,b=255]>
        at org.junit.Assert.fail(Assert.java:91)
        at org.junit.Assert.failNotEquals(Assert.java:645)
        at org.junit.Assert.assertEquals(Assert.java:126)
        at test.robot.javafx.embed.swing.SwingNodeBase.testAbove(SwingNodeBase.java:218)
        at test.robot.javafx.embed.swing.SwingNodeJDialogTest.testJDialogAbove(SwingNodeJDialogTest.java:42)

test.robot.javafx.embed.swing.SwingNodeJDialogTest > testNodeRemovalAfterShow FAILED
    java.lang.AssertionError: JDialog is not above JavaFX stage expected:<java.awt.Color[r=0,g=0,b=255]> but was:<java.awt.Color[r=20,g=0,b=255]>
        at org.junit.Assert.fail(Assert.java:91)
        at org.junit.Assert.failNotEquals(Assert.java:645)
        at org.junit.Assert.assertEquals(Assert.java:126)
        at test.robot.javafx.embed.swing.SwingNodeBase.testAbove(SwingNodeBase.java:218)
        at test.robot.javafx.embed.swing.SwingNodeJDialogTest.testNodeRemovalAfterShow(SwingNodeJDialogTest.java:52)

test.robot.javafx.embed.swing.SwingNodeJDialogTest > testStageCloseAfterShow FAILED
    java.lang.AssertionError: JDialog is not above JavaFX stage expected:<java.awt.Color[r=0,g=0,b=255]> but was:<java.awt.Color[r=20,g=0,b=255]>
        at org.junit.Assert.fail(Assert.java:91)
        at org.junit.Assert.failNotEquals(Assert.java:645)
        at org.junit.Assert.assertEquals(Assert.java:126)
        at test.robot.javafx.embed.swing.SwingNodeBase.testAbove(SwingNodeBase.java:218)
        at test.robot.javafx.embed.swing.SwingNodeJDialogTest.testStageCloseAfterShow(SwingNodeJDialogTest.java:77)

test.robot.javafx.embed.swing.SwingNodeJDialogTest > testStageCloseBeforeShow FAILED
    java.lang.AssertionError: JDialog is not above JavaFX stage expected:<java.awt.Color[r=0,g=0,b=255]> but was:<java.awt.Color[r=20,g=0,b=255]>
        at org.junit.Assert.fail(Assert.java:91)
        at org.junit.Assert.failNotEquals(Assert.java:645)
        at org.junit.Assert.assertEquals(Assert.java:126)
        at test.robot.javafx.embed.swing.SwingNodeBase.testAbove(SwingNodeBase.java:218)
        at test.robot.javafx.embed.swing.SwingNodeJDialogTest.testStageCloseBeforeShow(SwingNodeJDialogTest.java:87)

I suspect some sort of difference in the color profile on that system (in which case this might be closed as not a bug), but will need to check. If not, then we will need to add tolerance to the color check of that test. I note that this particular test uses AWT Robot rather than FX Robot.
Comments
The color profile problem on the failing system in question was wrong. After setting the color profile to "sRGB IEC61966-2.1", the test consistently passes for me. Closing as "Not an issue".
07-02-2022

This might be a color profile issue on my system, then. If you can't reproduce it, go ahead and assign it to me.
15-04-2021

This test passes on my macBook pro 16" (2019) with macOS 11.1. I tried by running it individually as well as a part of whole systemTest run. It passed both the times.
15-04-2021