From 6f4b42d0c3363f6648f4448bf8af37a49a98e65e Mon Sep 17 00:00:00 2001 From: WANG CHAO <1229983126@qq.com> Date: Thu, 21 Mar 2019 21:53:10 +0800 Subject: [PATCH] Add workaround to solve headless test failure on Windows OS For headless test task, 'prism.order' property is used to choose the graph renderer to use. Currently, we specify this property to be 'sw'. 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 use the workaround suggested [3] to solve the problem. [1] https://github.com/javafxports/openjdk-jfx/issues/66 [2] https://github.com/javafxports/openjdk-jfx/issues/66#issuecomment-472693380 [3] https://github.com/javafxports/openjdk-jfx/issues/66#issuecomment-468370664 --- build.gradle | 1 + src/test/java/seedu/address/ui/GuiUnitTest.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/build.gradle b/build.gradle index e7b06512c8dd..0482ee0feaa9 100644 --- a/build.gradle +++ b/build.gradle @@ -65,6 +65,7 @@ dependencies { implementation group: 'org.openjfx', name: 'javafx-web', version: javafxVersion, classifier: 'mac' implementation group: 'org.openjfx', name: 'javafx-web', version: javafxVersion, classifier: 'linux' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.8.1' implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.7.0' implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.7.4' diff --git a/src/test/java/seedu/address/ui/GuiUnitTest.java b/src/test/java/seedu/address/ui/GuiUnitTest.java index d163c5748337..d9a03e693996 100644 --- a/src/test/java/seedu/address/ui/GuiUnitTest.java +++ b/src/test/java/seedu/address/ui/GuiUnitTest.java @@ -2,6 +2,7 @@ import java.util.Optional; +import org.apache.commons.lang3.SystemUtils; import org.junit.Rule; import guitests.GuiRobot; @@ -18,6 +19,12 @@ public abstract class GuiUnitTest { protected final GuiRobot guiRobot = new GuiRobot(); + static { + if (SystemUtils.IS_OS_WINDOWS) { + System.load("C:\\Windows\\System32\\WindowsCodecs.dll"); + } + } + /** * Retrieves the {@code query} node owned by the {@code rootNode}. *