Skip to content

Commit e2306cd

Browse files
committed
test: use pgrep for ready gateway fallback
1 parent 2a74145 commit e2306cd

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

test/e2e/test-issue-2478-crash-loop-recovery.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ sandbox_exec() {
108108
# 2026.5.x builds can show only `openclaw` in pgrep/ps even after the gateway
109109
# is ready. Prefer explicit gateway argv/title matches, then fall back to the
110110
# oldest live `openclaw` argv process when gateway.log proves it reached ready.
111-
# The fallback matches argv as well as comm because hosted Linux ps can show the
112-
# process comm as `node` even when pgrep reports argv as plain `openclaw`.
111+
# The fallback uses pgrep because hosted Linux diagnostics show pgrep can see
112+
# `311 openclaw` even when the ps columns used above still miss the process.
113113
gateway_pid() {
114114
local script
115115
script=$(
@@ -119,9 +119,7 @@ pid="$(ps -eo pid=,comm=,args= 2>/dev/null | awk '
119119
$2 == "openclaw-gateway" || $0 ~ /openclaw[[:space:]]+gateway([[:space:]]|$)/ || $0 ~ /openclaw-gateway/ { print $1 }
120120
' | sort -n | head -n 1)"
121121
if [ -z "$pid" ] && grep -Eq "\[gateway\] (ready|http server listening)" /tmp/gateway.log 2>/dev/null; then
122-
pid="$(ps -eo pid=,comm=,args= 2>/dev/null | awk '
123-
$2 == "openclaw" || $0 ~ /(^|[[:space:]])openclaw([[:space:]]|$)/ { print $1 }
124-
' | sort -n | head -n 1)"
122+
pid="$(pgrep -fo '[o]penclaw' 2>/dev/null || true)"
125123
fi
126124
printf "%s\n" "$pid"
127125
SH

0 commit comments

Comments
 (0)