App Development Troubleshooting And Hints

Java Fx Headless Tests Fail with GLXBadContext

Running Java Fx application tests in headless mode using monocle fails on Linux using the following error: libGL error: failed to create drawable, X Error of failed request: GLXBadContext Major opcode of failed request: 152 (GLX).

Did not happen on asl7 cluster environment, most likely because there is no graphic acceleration involved using remote desktop.

Full output example:

Project: common-uilib-fx (https://git.acc.gsi.de/fcc-applications/common-uilib-fx)

mvn test
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ common-uilib-fx ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running de.gsi.fcc.applications.common.uilib.fx.bindings.BindingUtilsTests
[INFO] Tests run: 13, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.042 s - in de.gsi.fcc.applications.common.uilib.fx.bindings.BindingUtilsTests
[INFO] Running de.gsi.fcc.applications.common.uilib.fx.layout.ShrinkPaneTest
[INFO] Tests run: 30, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.978 s - in de.gsi.fcc.applications.common.uilib.fx.layout.ShrinkPaneTest
[INFO] Running de.gsi.fcc.applications.common.uilib.fx.exceptionlistener.BackgroundExceptionUniqueFxLoggerTest
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.349 s - in de.gsi.fcc.applications.common.uilib.fx.exceptionlistener.BackgroundExceptionUniqueFxLoggerTest
[INFO] Running de.gsi.fcc.applications.common.uilib.fx.concurrent.AppTaskMessagesTest
[ERROR] libGL error: failed to create drawable
[ERROR] libGL error: failed to create drawable
[ERROR] X Error of failed request:  GLXBadContext
[ERROR]   Major opcode of failed request:  152 (GLX)
[ERROR]   Minor opcode of failed request:  26 (X_GLXMakeContextCurrent)
[ERROR]   Serial number of failed request:  30
[ERROR]   Current serial number in output stream:  30
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 53, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

Solution

Ideas found here https://www.reddit.com/r/linux_gaming/comments/mfw36e/x_error_of_failed_request_glxbadfbconfig_after/

Use LIBGL_ALWAYS_SOFTWARE=1 mvn test to make sure the software renderer is used.

…
[INFO] Running de.gsi.fcc.applications.common.uilib.fx.concurrent.AppTaskMessagesTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.018 s - in de.gsi.fcc.applications.common.uilib.fx.concurrent.AppTaskMessagesTest
[INFO] Running de.gsi.fcc.applications.common.uilib.fx.concurrent.ApplicationTaskTurnstileTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.582 s - in de.gsi.fcc.applications.common.uilib.fx.concurrent.ApplicationTaskTurnstileTest
…
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 110, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
Topic revision: r1 - 14 Jul 2021, BenjaminPeter
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback