[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 87a7956: Wait for Xvfb to become available be
From: |
Vadim Zeitlin |
Subject: |
[lmi-commits] [lmi] master 87a7956: Wait for Xvfb to become available before running the GUI test |
Date: |
Fri, 16 Apr 2021 13:53:51 -0400 (EDT) |
branch: master
commit 87a7956f30566a12e6068b27d7bfa271cf0425eb
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Vadim Zeitlin <vadim@tt-solutions.com>
Wait for Xvfb to become available before running the GUI test
In the CI environment, the test can be launched before the Xvfb server
becomes fully available, resulting in X connection errors and failure to
create any windows.
Work around this by waiting until we can connect to the server before
running the test. Waiting just once for 3 seconds seems to be enough to
avoid the problem, but wait for up to 30 seconds just to make sure that
if we fail, it's not due to the slow Xvfb startup.
---
.github/workflows/ci.yml | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5051edf..64bc4aa 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -297,4 +297,23 @@ jobs:
- name: Run GUI tests
if: matrix.mingw
- run: xvfb-run ./gui_test.sh
+ run: |
+ echo 'Launching Xvfb...'
+ Xvfb :10 -screen 0 1600x1200x24 &
+ num_tries=1
+ while true; do
+ if xset -d :10 -q >/dev/null 2>&1; then
+ break
+ fi
+
+ if [[ $num_tries -gt 10 ]]; then
+ echo 'Timed out waiting for Xvfb'
+ exit 1
+ fi
+
+ ((num_tries++))
+ echo "Still waiting for Xvfb (attempt #$num_tries)"
+ sleep 3
+ done
+ echo 'Xvfb seems to be available, launching the test.'
+ DISPLAY=:10 ./gui_test.sh
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [lmi] master 87a7956: Wait for Xvfb to become available before running the GUI test,
Vadim Zeitlin <=