xserver: Branch 'master' - 4 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Oct 9 14:24:38 UTC 2023


 test/scripts/xwayland-piglit.sh |   31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

New commits:
commit d5ef57f1efc967fbc88dfa0f0177be354caf039b
Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Tue Sep 26 17:23:32 2023 +0200

    test: Skip Xwayland test early if PIGLIT_DIR / XTEST_DIR isn't set
    
    No point starting weston and waiting for it to start up in that case.

diff --git a/test/scripts/xwayland-piglit.sh b/test/scripts/xwayland-piglit.sh
index 97a1759d9..9d6e54d01 100755
--- a/test/scripts/xwayland-piglit.sh
+++ b/test/scripts/xwayland-piglit.sh
@@ -1,5 +1,17 @@
 #!/bin/bash -e
 
+if test "x$XTEST_DIR" = "x"; then
+    echo "XTEST_DIR must be set to the directory of the xtest repository."
+    # Exit as a "skip" so make check works even without xtest.
+    exit 77
+fi
+
+if test "x$PIGLIT_DIR" = "x"; then
+    echo "PIGLIT_DIR must be set to the directory of the piglit repository."
+    # Exit as a "skip" so make check works even without piglit.
+    exit 77
+fi
+
 # this times out on Travis, because the tests take too long.
 if test "x$TRAVIS_BUILD_DIR" != "x"; then
     exit 77
commit 129ec1cb8413c559766d9fd3771857bf27e31120
Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Tue Sep 26 16:27:04 2023 +0200

    test: Propagate Xwayland stdout/stderr output and exit status
    
    If waiting for weston to start times out. This should make it easier
    to diagnose issues.

diff --git a/test/scripts/xwayland-piglit.sh b/test/scripts/xwayland-piglit.sh
index 42209e8ab..97a1759d9 100755
--- a/test/scripts/xwayland-piglit.sh
+++ b/test/scripts/xwayland-piglit.sh
@@ -23,7 +23,11 @@ export WAYLAND_DISPLAY=wayland-$$
 trap 'kill $WESTON_PID' EXIT
 
 # Wait for weston to initialize before starting Xwayland
-timeout --preserve-status 5s bash -c "while ! $XSERVER_BUILDDIR/hw/xwayland/Xwayland -pogo -displayfd 1 &>/dev/null; do sleep 1; done"
+if ! timeout 5s bash -c "while ! $XSERVER_BUILDDIR/hw/xwayland/Xwayland -pogo -displayfd 1 &>/dev/null; do sleep 1; done"; then
+    # Try running Xwayland one more time, so we can propagate its stdout/stderr
+    # output and exit status
+    $XSERVER_BUILDDIR/hw/xwayland/Xwayland -pogo -displayfd 1
+fi
 
 # Start an Xwayland server
 export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xwayland
commit e58203c1e2c00184cb2ba265e6d19bde84918c2d
Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Tue Sep 26 16:39:27 2023 +0200

    test: Kill weston whenever shell exits
    
    This script runs with -e, so if the timeout command returns a non-0
    exit status (meaning the while loop timed out), the script exits
    immediately as well.
    
    This would leave weston running in the background, which resulted in
    meson waiting for weston to terminate until hitting meson's own timeout.
    
    Instead, explicitly kill weston whenever the shell exits. This results
    in meson recording the test as failed immediately.
    
    As a bonus, we can drop the special handling around run-piglit.sh.
    
    v2:
    * Use trap (José Expósito)
    v3:
    * Explicitly use bash, and document a bashism we rely on
      (Olivier Fourdan)

diff --git a/test/scripts/xwayland-piglit.sh b/test/scripts/xwayland-piglit.sh
index 16cf7e2a0..42209e8ab 100755
--- a/test/scripts/xwayland-piglit.sh
+++ b/test/scripts/xwayland-piglit.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
 
 # this times out on Travis, because the tests take too long.
 if test "x$TRAVIS_BUILD_DIR" != "x"; then
@@ -17,6 +17,11 @@ weston --no-config --backend=headless-backend.so --socket=wayland-$$ &
 WESTON_PID=$!
 export WAYLAND_DISPLAY=wayland-$$
 
+# Need to kill weston before exiting, or meson will time out waiting for it to terminate
+# We rely on bash's behaviour, which executes the EXIT trap handler even if the shell is
+# terminated due to receiving a signal
+trap 'kill $WESTON_PID' EXIT
+
 # Wait for weston to initialize before starting Xwayland
 timeout --preserve-status 5s bash -c "while ! $XSERVER_BUILDDIR/hw/xwayland/Xwayland -pogo -displayfd 1 &>/dev/null; do sleep 1; done"
 
@@ -38,10 +43,4 @@ PIGLIT_ARGS="$PIGLIT_ARGS -x xsetfontpath at 2"
 
 export PIGLIT_ARGS
 
-# Do not let run-piglit.sh exit status terminate this script prematurely
-set +e
 $XSERVER_DIR/test/scripts/run-piglit.sh
-PIGLIT_STATUS=$?
-
-kill $WESTON_PID
-exit $PIGLIT_STATUS
commit 3e938ed042e1a1a38225a5f9230d8922bf3e3f00
Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Tue Sep 26 16:43:41 2023 +0200

    test: Wait only up to 5 seconds for weston to start up
    
    This should be plenty even on CI, no need to wait for a whole minute if something
    goes wrong.

diff --git a/test/scripts/xwayland-piglit.sh b/test/scripts/xwayland-piglit.sh
index 7eac3d6c5..16cf7e2a0 100755
--- a/test/scripts/xwayland-piglit.sh
+++ b/test/scripts/xwayland-piglit.sh
@@ -18,7 +18,7 @@ WESTON_PID=$!
 export WAYLAND_DISPLAY=wayland-$$
 
 # Wait for weston to initialize before starting Xwayland
-timeout --preserve-status 60s bash -c "while ! $XSERVER_BUILDDIR/hw/xwayland/Xwayland -pogo -displayfd 1 &>/dev/null; do sleep 1; done"
+timeout --preserve-status 5s bash -c "while ! $XSERVER_BUILDDIR/hw/xwayland/Xwayland -pogo -displayfd 1 &>/dev/null; do sleep 1; done"
 
 # Start an Xwayland server
 export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xwayland


More information about the xorg-commit mailing list