[Rev 02] RFR: 8239822: Intermittent unit test failures in RegionCSSTest

Kevin Rushforth kcr at openjdk.java.net
Mon Feb 24 19:36:47 UTC 2020


> This is a fix for an intermittent test failure affecting `test.javafx.scene.layout.RegionCSSTest`. This turns out to be a test bug in `test.javafx.scene.CssStyleHelperTest`, which was added as part of [JDK-8237469](https://bugs.openjdk.java.net/browse/JDK-8237469). RegionCSSTest is a victim of this bug.
> 
> Except for the systemTests project, all unit tests are run in the same JVM, so each test class must ensure that any modified global state is restored after the tests are run. The CssStyleHelperTest leaves a userAgentStyleSheet set, which is a global (per Application) attribute, so any subsequent tests will be run with that stylesheet set. If the last test that is run in CssStyleHelperTest sets a style sheet with `"-fx-background"` then it will cause assertion failures in 78 of the tests in RegionCSSTest. 
> 
> The fix is to cleanup the global userAgentStyleSheet, along with any other state that is set, in an  `@AfterClass` cleanup method.

The pull request has been updated with 1 additional commit.

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

Added commits:
 - c3196e3d: Apply the same fix to two additional test classes to address review comments.

Changes:
  - all: https://git.openjdk.java.net/jfx/pull/124/files
  - new: https://git.openjdk.java.net/jfx/pull/124/files/8423f5b8..c3196e3d

Webrevs:
 - full: https://webrevs.openjdk.java.net/jfx/124/webrev.02
 - incr: https://webrevs.openjdk.java.net/jfx/124/webrev.01-02

  Stats: 26 lines in 2 files changed: 22 ins; 2 del; 2 mod
  Patch: https://git.openjdk.java.net/jfx/pull/124.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/124/head:pull/124

PR: https://git.openjdk.java.net/jfx/pull/124


More information about the openjfx-dev mailing list