Skip to content

Commit

Permalink
build.gradle: set OS-dependent 'prism.order' property
Browse files Browse the repository at this point in the history
For headless test task, 'prism.order' property is used to choose the
graph renderer to use. Currently, we specify this property to be 'sw'
for all platforms.

However, this property triggers a bug of openjdk-jfx with headless
mode [1]. This property will cause Java Runtime Error for Windows OS
including AppVeyor:

    # A fatal error has been detected by the Java Runtime Environment:
    #
    #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffd95b64879, pid=1476, tid=2640
    #
    # JRE version: OpenJDK Runtime Environment (11.0.1+13) (build 11.0.1+13)
    # Java VM: OpenJDK 64-Bit Server VM (11.0.1+13, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
    # Problematic frame:
    # C  [javafx_font.dll+0x4879]

This bug has been identified and will be fixed in future release [2].
Let's set 'prism.order' property to be 'd3d' on Windows OS but retain
it to be 'sw' on other platforms as a temporary workaround to solve
the problem.

[1] javafxports/openjdk-jfx#66
[2] javafxports/openjdk-jfx#66 (comment)
  • Loading branch information
fzdy1914 committed Mar 21, 2019
1 parent 6d8f0a7 commit 2f1045c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ test {
}

doFirst {
if (SystemUtils.IS_OS_WINDOWS) {
System.load("C:\\Windows\\System32\\WindowsCodecs.dll")
}
boolean runGuiTests = gradle.taskGraph.hasTask(guiTests)
boolean runNonGuiTests = gradle.taskGraph.hasTask(nonGuiTests)

Expand All @@ -188,12 +191,18 @@ test {

task headless {
doLast {
String orderProperty
if (SystemUtils.IS_OS_WINDOWS) {
orderProperty = 'd3d'
} else {
orderProperty = 'sw'
}
println 'Setting headless mode properties.'
test {
systemProperties = [
'testfx.robot': 'glass',
'testfx.headless': 'true',
'prism.order': 'sw',
'prism.order': orderProperty,
'prism.text': 't2k',
]
}
Expand Down

0 comments on commit 2f1045c

Please sign in to comment.