Skip to content

Commit 999c762

Browse files
committed
fix(weston-simple-egl): retry base Weston runtime detection before skipping
On base builds, weston-simple-egl intentionally reuses an already running Weston session instead of starting its own compositor. In test sequences where a previous DRM-exclusive test has just restored Weston, the socket and session may not be ready immediately when this test starts. Add a short wait-and-retry path on base builds before skipping when no usable Wayland socket is found or when the initial Wayland probe fails. This keeps the existing base-build policy intact while making the test less sensitive to compositor recovery timing. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
1 parent 9d01e66 commit 999c762

1 file changed

Lines changed: 36 additions & 3 deletions

File tree

  • Runner/suites/Multimedia/Graphics/weston-simple-egl

Runner/suites/Multimedia/Graphics/weston-simple-egl/run.sh

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,25 @@ if [ -n "$sock" ] && command -v adopt_wayland_env_from_socket >/dev/null 2>&1; t
161161
fi
162162
fi
163163

164+
# On base, do not start Weston here, but allow a short wait for an already
165+
# expected Weston runtime to come back after a previous DRM-exclusive test.
166+
if [ -z "$sock" ] && [ "$BUILD_FLAVOUR" = "base" ]; then
167+
if command -v weston_wait_ready >/dev/null 2>&1; then
168+
log_info "No usable Wayland socket yet on base build; waiting briefly for Weston runtime..."
169+
if weston_wait_ready 10; then
170+
if command -v discover_wayland_socket_anywhere >/dev/null 2>&1; then
171+
sock=$(discover_wayland_socket_anywhere | head -n 1 || true)
172+
fi
173+
if [ -n "$sock" ] && command -v adopt_wayland_env_from_socket >/dev/null 2>&1; then
174+
log_info "Base Weston runtime became ready: $sock"
175+
if ! adopt_wayland_env_from_socket "$sock"; then
176+
log_warn "Failed to adopt env from $sock after wait"
177+
fi
178+
fi
179+
fi
180+
fi
181+
fi
182+
164183
# If no usable socket yet:
165184
# - base: SKIP (do not try to start/stop Weston)
166185
# - overlay: try starting private Weston (helper) then re-discover/adopt
@@ -217,9 +236,23 @@ fi
217236

218237
if command -v wayland_connection_ok >/dev/null 2>&1; then
219238
if ! wayland_connection_ok; then
220-
log_fail "Wayland connection test failed; cannot run ${TESTNAME}."
221-
echo "${TESTNAME} SKIP" >"$RES_FILE"
222-
exit 0
239+
if [ "$BUILD_FLAVOUR" = "base" ] && command -v weston_wait_ready >/dev/null 2>&1; then
240+
log_warn "Initial Wayland connection test failed; waiting briefly and retrying..."
241+
if weston_wait_ready 5; then
242+
if command -v discover_wayland_socket_anywhere >/dev/null 2>&1; then
243+
sock=$(discover_wayland_socket_anywhere | head -n 1 || true)
244+
fi
245+
if [ -n "$sock" ] && command -v adopt_wayland_env_from_socket >/dev/null 2>&1; then
246+
adopt_wayland_env_from_socket "$sock" || true
247+
fi
248+
fi
249+
fi
250+
251+
if ! wayland_connection_ok; then
252+
log_fail "Wayland connection test failed; cannot run ${TESTNAME}."
253+
echo "${TESTNAME} SKIP" >"$RES_FILE"
254+
exit 0
255+
fi
223256
fi
224257
log_info "Wayland connection test: OK"
225258
else

0 commit comments

Comments
 (0)