I am not able to do tests form testFX in jenkins using gradle

Hi I am having trouble when i try to run testFX tests in jenkins.
I hava to similar projects one with testFX test and the other without.
The project without testFX runs fine.

The one with testFX test finish with BUILD FAILED.

First in eclipse the tests are ok.
Running the test with gradle in a terminal are also ok.
In both cases it is possible to see the GUI and the actions,

One of the tests is

package tests;

import static org.testfx.api.FxAssert.verifyThat;
import static org.testfx.matcher.control.LabeledMatchers.hasText;

import org.junit.jupiter.api.Test;
import org.testfx.framework.junit5.ApplicationTest;
import org.testfx.util.WaitForAsyncUtils;

import app.ClickApplication;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class ClickApplicationTest extends ApplicationTest {
@Override public void start(Stage stage) {
Parent sceneRoot = new ClickApplication.ClickPane();
Scene scene = new Scene(sceneRoot, 100, 100);
stage.setScene(scene);
stage.show();
}

@Test public void should_contain_button() {
    // expect:
    verifyThat(".button", hasText("click me!"));
}

@Test public void should_click_on_button() {
    // when:
    clickOn(".button");
    
    WaitForAsyncUtils.waitForFxEvents();

    // then:
    verifyThat(".button", hasText("clicked!"));
    //verifyThat(".button", hasText("click me!"));
}

}

The file for the Click application is :

package app;

import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class ClickApplication extends Application {
// application for acceptance tests.
@Override public void start(Stage stage) {
Parent sceneRoot = new ClickPane();
Scene scene = new Scene(sceneRoot, 100, 100);
stage.setScene(scene);
stage.show();
}

// scene object for unit tests
public static class ClickPane extends StackPane {
    public ClickPane() {
        super();
        Button button = new Button("click me!");
        button.setOnAction(actionEvent -> button.setText("clicked!"));
        getChildren().add(button);
    }
}

}

The build.gradle file is :

/* * This file was generated by the Gradle 'init' task. * * This generated file contains a sample Java Library project to get you started. * For more details take a look at the Java Libraries chapter in the Gradle * user guide available at https://docs.gradle.org/4.9/userguide/java_library_plugin.html * jFXtestFX * jFXtestFX * jFXtestFX * jFXtestFX */

plugins {
id ‘java’ // to work with java files
id ‘eclipse’ // optional (to generate Eclipse project files)
}

repositories {
mavenCentral() // to get the jars
}

dependencies {

testCompile(group: "org.testfx", name: "testfx-junit5", version: "4.0.15-alpha")
testCompile('org.testfx:testfx-core:4.0.15-alpha') {
exclude group: 'org.testfx', module: 'testfx-internal-java8'
}
testCompile(group: "org.testfx", name: "testfx-core", version: "4.0.15-alpha") //depends de testfx-junit5

testCompile("org.testfx:openjfx-monocle:jdk-9+181")
testCompile('org.junit.jupiter:junit-jupiter-api:5.3.2')
testCompile('org.junit.jupiter:junit-jupiter-params:5.3.2')
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.3.2')

testImplementation(
        'org.junit.jupiter:junit-jupiter-api:5.3.2'
)

testRuntimeOnly(
‘org.junit.jupiter:junit-jupiter-engine:5.3.2’,
)
}

test {
jvmArgs “-Dheadless=${project.hasProperty(‘headless’) ? project.headless : true}”

useJUnitPlatform()

testLogging {
	events "passed", "skipped", "failed"
}

}

In Jenkins source code management, build trigers,are ok I delete workspace before build starts.
Build Invoke Gradle, the version is 5.1.1, in eclipse is 5.1.
Tasks I indicate test-info

This is the console output

Démarré par l’utilisateur Ruben Gonzalez-Rubio Building in workspace /var/lib/jenkins/workspace/jPGtestFX [WS-CLEANUP] Deleting project workspace… [WS-CLEANUP] Deferred wipeout is used… [WS-CLEANUP] Done Checking out a fresh workspace because there’s no workspace at /var/lib/jenkins/workspace/jPGtestFX Cleaning local Directory . Checking out svn+ssh://gonr1001@svn.gel.usherbrooke.ca/grp/svn/devJava/projectJGtestFX/trunk/jPGtestFX at revision ‘2019-01-26T14:26:58.528 -0500’ --quiet Using sole credentials gonr1001/****** in realm ‘gonr1001@svn+ssh://svn.gel.usherbrooke.ca’ Using sole credentials gonr1001/****** in realm ‘gonr1001@svn+ssh://svn.gel.usherbrooke.ca’ At revision 50 No changes for svn+ssh://gonr1001@svn.gel.usherbrooke.ca/grp/svn/devJava/projectJGtestFX/trunk/jPGtestFX since the previous build [Gradle] - Launching build. [jPGtestFX] $ /var/lib/jenkins/tools/hudson.plugins.gradle.GradleInstallation/Gradle/bin/gradle -Pheadless=true test --info Initialized native services in: /var/lib/jenkins/.gradle/native Removing 0 daemon stop events from registry Starting a Gradle Daemon (subsequent builds will be faster) Starting process ‘Gradle build daemon’. Working directory: /var/lib/jenkins/.gradle/daemon/5.1.1 Command: /usr/java/jdk-9.0.4/bin/java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=CA -Duser.language=fr -Duser.variant -cp /var/lib/jenkins/tools/hudson.plugins.gradle.GradleInstallation/Gradle/lib/gradle-launcher-5.1.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 5.1.1 Successfully started process ‘Gradle build daemon’ An attempt to start the daemon took 2.175 secs. The client will now receive all logging from the daemon (pid: 30342). The daemon log file: /var/lib/jenkins/.gradle/daemon/5.1.1/daemon-30342.out.log Starting build in new daemon [memory: 536,9 MB] Closing daemon’s stdin at end of input. The daemon will no longer process any standard input. Using 2 worker leases. Starting Build Settings evaluated using settings file ‘/var/lib/jenkins/workspace/jPGtestFX/settings.gradle’. Projects loaded. Root project using build file ‘/var/lib/jenkins/workspace/jPGtestFX/build.gradle’. Included projects: [root project ‘jPGtestFX’] > Configure project : Evaluating root project ‘jPGtestFX’ using build file ‘/var/lib/jenkins/workspace/jPGtestFX/build.gradle’. All projects evaluated. Selected primary task ‘test’ from project : Tasks to be executed: [task ‘:compileJava’, task ‘:processResources’, task ‘:classes’, task ‘:compileTestJava’, task ‘:processTestResources’, task ‘:testClasses’, task ‘:test’] : compileJava (Thread[Daemon worker,5,main]) started. > Task :compileJava Task ‘:compileJava’ is not up-to-date because: No history is available. All input files are considered out-of-date for incremental task ‘:compileJava’. Full recompilation is required because no incremental change information is available. This is usually caused by clean builds or changing compiler arguments. Compiling with JDK Java compiler API. Created classpath snapshot for incremental compilation in 0.011 secs. : compileJava (Thread[Daemon worker,5,main]) completed. Took 1.908 secs. : processResources (Thread[Daemon worker,5,main]) started. > Task :processResources Task ‘:processResources’ is not up-to-date because: No history is available. : processResources (Thread[Daemon worker,5,main]) completed. Took 0.056 secs. : classes (Thread[Daemon worker,5,main]) started. > Task :classes Skipping task ‘:classes’ as it has no actions. : classes (Thread[Daemon worker,5,main]) completed. Took 0.0 secs. : compileTestJava (Thread[Daemon worker,5,main]) started. > Task :compileTestJava Task ‘:compileTestJava’ is not up-to-date because: No history is available. All input files are considered out-of-date for incremental task ‘:compileTestJava’. Full recompilation is required because no incremental change information is available. This is usually caused by clean builds or changing compiler arguments. Compiling with JDK Java compiler API. Created classpath snapshot for incremental compilation in 0.211 secs. : compileTestJava (Thread[Daemon worker,5,main]) completed. Took 1.455 secs. : processTestResources (Thread[Daemon worker,5,main]) started. >

Task :processTestResources** NO-SOURCE
Skipping task ‘:processTestResources’ as it has no source files and no previous output files.
:processTestResources** (Thread[Daemon worker,5,main]) completed. Took 0.007 secs.
:testClasses** (Thread[Daemon worker,5,main]) started.

Task :testClasses
Skipping task ‘:testClasses’ as it has no actions.
:testClasses (Thread[Daemon worker,5,main]) completed. Took 0.0 secs.
:test (Thread[Daemon worker,5,main]) started.
Gradle Test Executor 1 started executing tests.

Task :test
Task ‘:test’ is not up-to-date because:
No history is available.
Starting process ‘Gradle Test Executor 1’. Working directory:
/var/lib/jenkins/workspace/jPGtestFX Command: /usr/java/jdk-9.0.4/bin/java -Djava.awt.headless=true -Dtestfx.robot=glass -Dtestfx.headless=true -
Dprism.order=sw -Dprism.text=t2k -Dtestfx.setup.timeout=2500 -Dorg.gradle.native=false @/tmp/gradle-worker-classpath18392913070249359000txt -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=CA -Duser.language=fr -Duser.variant -ea
worker.org.gradle.process.internal.worker.GradleWorkerMain ‘Gradle Test Executor 1’
Successfully started process ‘Gradle Test Executor 1’

sample.MainTest > testEnglishInput() SKIPPED >

Task :test FAILED : test (Thread[Daemon worker,5,main]) completed. Took 1 mins 16.188 secs.

FAILURE: Build failed with an exception. *

What went wrong:
Execution failed for task ‘:test’. > Process ‘Gradle Test Executor 1’ finished with non-zero exit value 143 This problem might be caused by incorrect test process configuration. Please refer to the test execution section in the user guide at https://docs.gradle.org/5.1.1/userguide/java_testing.html#sec:test_execution *

Try: Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights. *

Get more help at https://help.gradle.org

BUILD FAILED in 1m 28s 4 actionable tasks: 4 executed Le build a été annulé Aborted by Ruben Gonzalez-Rubio Finished: ABORTED

Any idea?

143 often means that the process was sent a SIGTERM signal to stop it running, either by the OS, or by something killing it.

There’s another post from late last year that seems to show increasing the available ram to the build might help: