Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8336272

SizeToSceneTest: fullScreen tests fail on Ubuntu 22.04

XMLWordPrintable

    • b01
    • linux

        After the fix for JDK-8326619, we started seeing test failures on Ubuntu 22.04 LTS during our nightly headful test run.

        To reproduce, run the following on Ubuntu 22.04 LTS (also happens on an older 16.04 system) :

        $ gradle --info -PFULL_TEST=true -PUSE_ROBOT=true :systemTests:test --tests SizeToSceneTest

        SizeToSceneTest > testInitialSizeOnSizeToSceneThenFullscreen() FAILED
            org.opentest4j.AssertionFailedError: expected: <1920.0> but was: <1855.0>
                at app//org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
                at app//org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
                at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:86)
                at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:81)
                at app//org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1010)
                at app//test.javafx.stage.SizeToSceneTest.assertStageScreenBounds(SizeToSceneTest.java:77)
                at app//test.javafx.stage.SizeToSceneTest.testInitialSizeOnSizeToSceneThenFullscreen(SizeToSceneTest.java:152)

        SizeToSceneTest > testInitialSizeAfterShowFullscreenThenSizeToScene() FAILED
            org.opentest4j.AssertionFailedError: expected: <1920.0> but was: <1855.0>
                at app//org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
                at app//org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
                at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:86)
                at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:81)
                at app//org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1010)
                at app//test.javafx.stage.SizeToSceneTest.assertStageScreenBounds(SizeToSceneTest.java:77)
                at app//test.javafx.stage.SizeToSceneTest.testInitialSizeAfterShowFullscreenThenSizeToScene(SizeToSceneTest.java:188)

        SizeToSceneTest > testInitialSizeAfterShowSizeToSceneThenFullscreen() FAILED
            org.opentest4j.AssertionFailedError: expected: <1920.0> but was: <1855.0>
                at app//org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
                at app//org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
                at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:86)
                at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:81)
                at app//org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1010)
                at app//test.javafx.stage.SizeToSceneTest.assertStageScreenBounds(SizeToSceneTest.java:77)
                at app//test.javafx.stage.SizeToSceneTest.testInitialSizeAfterShowSizeToSceneThenFullscreen(SizeToSceneTest.java:164)

        SizeToSceneTest > testInitialSizeOnFullscreenThenSizeToScene() FAILED
            org.opentest4j.AssertionFailedError: expected: <1920.0> but was: <1855.0>
                at app//org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
                at app//org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
                at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:86)
                at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:81)
                at app//org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1010)
                at app//test.javafx.stage.SizeToSceneTest.assertStageScreenBounds(SizeToSceneTest.java:77)
                at app//test.javafx.stage.SizeToSceneTest.testInitialSizeOnFullscreenThenSizeToScene(SizeToSceneTest.java:130)

        I tracked this down to a bad assumption that the test makes: namely, that full screen windows will always be within the visual bounds. It is possible (and common on some platforms) for a full screen window to cover the entire screen bounds, not just the visible bounds.

        While looking into this, I also noticed that the expected and actual arguments to assertEquals are backwards, which makes the error message confusing. In reality the test is expecting the width to be 1011 (the width of the visual bounds) while the actual is 1117. This should be fixed at the same time by swapping the arguments (for all of the tests in that class, not just the full screen tests).

              mhanl Marius Hanl
              kcr Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: