From c36bd7384edb2d535c626ee122a79fcb759d9da1 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 28 Mar 2026 07:06:26 +0100 Subject: [PATCH] =?UTF-8?q?wayland:=20Phase=2051=20=E2=80=94=20multi-clien?= =?UTF-8?q?t:=20two=20simultaneous=20toplevels=20managed=20cleanly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/wl-smoke-test.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/wl-smoke-test.sh b/tests/wl-smoke-test.sh index f32fa52..a5c62b3 100755 --- a/tests/wl-smoke-test.sh +++ b/tests/wl-smoke-test.sh @@ -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