Create virtual display to avoid false errors in Cypress runs
In RKE2 runs, Cypress runs produce the following errors:
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[5419:0728/143340.536560:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[5419:0728/143340.540779:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
This is a Google Chrome problem on Linux systems. Normally you would pass --disable-gpu and --no-sandbox to Chrome. If you add these options to the Cypress config file for Chrome, it does not remove the problem. Cypress calls chrome without these settings prior to running the test. You can get the same error by running cypress info
These errors are benign and do not cause a different exit code. You could simply redirect STDERR to /dev/null, but you may hide something important
To fix this, you can add a virtual monitor with Xvfb (which is a dependency of Cypress):
# Start virtual monitor
export DISPLAY=:1
Xvfb :1 -screen 0 1024x768x16 2>/dev/null &
# After running test, stop virtual monitor
# We probably don't need this since the container will be killed after we run anyways
unset DISPLAY
kill %1