wayland: Phase 51 — multi-client: two simultaneous toplevels managed cleanly

Run two weston-simple-shm processes in parallel during the smoke test
and verify that all three toplevels (one from the single-client section
plus two from the parallel section) are managed and unmanaged without
crashing the compositor.  The synthetic-ID counter, focus chain, and
wUnmanageWindow path all survive the multi-client scenario.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Levi Neely 2026-03-28 07:06:26 +01:00
parent 14da9a65ae
commit c36bd7384e
1 changed files with 22 additions and 0 deletions

View File

@ -34,6 +34,8 @@
# wManageWindow; wWindowFocus/Unfocus guarded on frame!=NULL
# 16. (Phase 50) client_get_pid returns real PID via wl_client_get_credentials;
# logged as pid= in wManageWindow succeeded line
# 17. (Phase 51) two simultaneous clients both managed and unmanaged cleanly;
# compositor survives multi-client scenario
#
# This test grows as wl_backend vtable slots are implemented.
#
@ -196,6 +198,26 @@ if command -v weston-simple-shm >/dev/null 2>&1; then
[ -n "$PID" ] && [ "$PID" -gt 0 ] 2>/dev/null \
|| die "compositor did not log a valid pid= for managed toplevel"
echo " pid check: client PID=$PID retrieved via wl_client_get_credentials"
# -- 15. Phase 51: two simultaneous clients both managed --------------
#
# Launch two weston-simple-shm processes in parallel (2s and 3s).
# Both should be managed and focused; both should unmap cleanly.
(WAYLAND_DISPLAY="$WL_SOCK" timeout 2s weston-simple-shm 2>/dev/null) &
C1=$!
(WAYLAND_DISPLAY="$WL_SOCK" timeout 3s weston-simple-shm 2>/dev/null) &
C2=$!
wait "$C1" || true
wait "$C2" || true
sleep 0.5 # let compositor log unmap events
kill -0 "$WM_PID" 2>/dev/null \
|| die "compositor crashed during two-client test"
MANAGED_COUNT=$(grep -c 'wManageWindow succeeded' /tmp/wl-smoke-stderr || true)
[ "$MANAGED_COUNT" -ge 3 ] \
|| die "expected >=3 wManageWindow succeeded entries (1+2 clients), got $MANAGED_COUNT"
echo " multi-client check: $MANAGED_COUNT toplevels managed across both sessions"
else
echo " client check: skipped (weston-simple-shm not installed)"
fi