RFR: 8356687: [TestBug] SWT tests do not run on macOS
Jayathirth D V
jdv at openjdk.org
Tue Sep 9 10:35:45 UTC 2025
We have enabled swt tests under [JDK-8169285](https://bugs.openjdk.org/browse/JDK-8169285) but they were disabled on macOS as they throw below exception :
FXCanvasScaledTest STANDARD_OUT
***WARNING: Display must be created on main thread due to Cocoa restrictions. Use vmarg -XstartOnFirstThread
FXCanvasScaledTest > initializationError FAILED
org.eclipse.swt.SWTException: Invalid thread access
Using `-XstartOnFirstThread` flag in gradle was not reliable and the issue was tracked under https://issues.gradle.org/browse/GRADLE-3290 and later under https://github.com/gradle/gradle/issues/864. This gradle issue is resolved and we can use `-XstartOnFirstThread` and enable SWT tests on macOS.
With `-XstartOnFirstThread`, SWT tests run fine on macOS.
-------------
Commit messages:
- 8356687: [TestBug] SWT tests do not run on macOS
Changes: https://git.openjdk.org/jfx/pull/1888/files
Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1888&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8356687
Stats: 5 lines in 1 file changed: 3 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jfx/pull/1888.diff
Fetch: git fetch https://git.openjdk.org/jfx.git pull/1888/head:pull/1888
PR: https://git.openjdk.org/jfx/pull/1888
More information about the openjfx-dev
mailing list