Remove the IPC socket of each shell a test starts (#13443)

* Answer the Elsewhen panel over the shell's IPC socket

The Elsewhen panel arrived with a plain IpcHandler, so omarchy-shell
reached it only through the slower qs ipc fallback, and the test that
every first-party handler registers as ShellIpc failed on quattro.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Remove the IPC socket of each shell a test starts

The runtime smoke and screenshot sanity tests start the real shell from a
temporary copy and kill it, which leaves its IPC socket behind in
XDG_RUNTIME_DIR. A session that runs the suite a few times collected
dozens of them.

base-test.sh gains shell_ipc_socket, which derives a shell's socket as
omarchy-shell does, and both tests remove theirs in cleanup. The socket
test derives its fixture's socket through it too, so the helper cannot
drift from omarchy-shell.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier HanssonandClaude Opus 5.5 authored and GitHub committed 2026-09-27 21:57:46 +02:00
1 parent 0066ea216b
commit 82979b9a18
5 files changed
+13 -3

No files matched your search

+1 -1
View File
@@ -616,7 +616,7 @@ Panel {
onTriggered: root.refresh() onTriggered: root.refresh()
} }
IpcHandler { ShellIpc {
target: root.ipcTarget target: root.ipcTarget
function open(): void { root.open() } function open(): void { root.open() }
function close(): void { root.close() } function close(): void { root.close() }
+9
View File
@@ -27,6 +27,15 @@ fail() {
exit 1 exit 1
} }
# The IPC socket a shell running an OMARCHY_PATH's config on this display
# serves, derived as omarchy-shell derives it. A test that starts the real
# shell removes it afterwards: killing the shell leaves the file behind.
shell_ipc_socket() {
local id
id=$(printf '%s\n%s' "$1/shell" "${WAYLAND_DISPLAY:-}" | md5sum)
printf '%s/omarchy-shell-%s.sock\n' "${XDG_RUNTIME_DIR:-/run/user/$UID}" "${id:0:16}"
}
require_command() { require_command() {
local command="$1" local command="$1"
+1
View File
@@ -12,6 +12,7 @@ cleanup() {
kill "$QS_PID" 2>/dev/null || true kill "$QS_PID" 2>/dev/null || true
wait "$QS_PID" 2>/dev/null || true wait "$QS_PID" 2>/dev/null || true
fi fi
[[ -n ${test_root:-} ]] && rm -f "$(shell_ipc_socket "$test_root")"
[[ -n $TMPDIR && -d $TMPDIR ]] && rm -rf "$TMPDIR" [[ -n $TMPDIR && -d $TMPDIR ]] && rm -rf "$TMPDIR"
return 0 return 0
} }
+1
View File
@@ -12,6 +12,7 @@ cleanup() {
kill "$QS_PID" 2>/dev/null || true kill "$QS_PID" 2>/dev/null || true
wait "$QS_PID" 2>/dev/null || true wait "$QS_PID" 2>/dev/null || true
fi fi
[[ -n ${test_root:-} ]] && rm -f "$(shell_ipc_socket "$test_root")"
if [[ -n $TMPDIR && -d $TMPDIR ]]; then if [[ -n $TMPDIR && -d $TMPDIR ]]; then
rm -rf "$TMPDIR" rm -rf "$TMPDIR"
fi fi
+1 -2
View File
@@ -22,8 +22,7 @@ touch "$root_dir/shell/shell.qml"
# The shell names its socket after its config and display, as omarchy-shell # The shell names its socket after its config and display, as omarchy-shell
# derives it. # derives it.
display="test-display" display="test-display"
socket_id=$(printf '%s\n%s' "$root_dir/shell" "$display" | md5sum) socket=$(XDG_RUNTIME_DIR="$run_dir" WAYLAND_DISPLAY="$display" shell_ipc_socket "$root_dir")
socket="$run_dir/omarchy-shell-${socket_id:0:16}.sock"
# qs is the fallback: it records that it ran and answers. # qs is the fallback: it records that it ran and answers.
cat >"$stub_bin/qs" <<'SH' cat >"$stub_bin/qs" <<'SH'