From 3a0843dcfde8bf3ee96981c8510cab90b821b452 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 16 Oct 2026 16:00:54 +0000 Subject: [PATCH] fix(e2e/live): start-backend.sh records the server's pid, not a subshell's MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only the `nohup …` command is backgrounded now, after the `cd`, so `$!` is the `objectstack dev` process itself. Backgrounding `cd … && nohup …` as one list recorded the forked subshell's pid: stop-backend.sh killed the subshell and left the server on its port, and the `already running` guard never matched, because the subshell's cmdline is the script's own. Claude-Session: https://claude.ai/code/session_016PVjjuVPte5XEJvaQx1E4t Co-authored-by: Claude --- e2e/live/ci/start-backend.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/e2e/live/ci/start-backend.sh b/e2e/live/ci/start-backend.sh index 547ec18abf..8f54de6cf7 100755 --- a/e2e/live/ci/start-backend.sh +++ b/e2e/live/ci/start-backend.sh @@ -171,8 +171,17 @@ start() { echo "[live-backend] starting objectstack dev on :$PORT (log: $BACKEND_DIR/backend.log)" # --fresh: throwaway sqlite db, auto-removed on SIGTERM. OS_CLOUD_URL=off: # no marketplace/cloud calls — the lane must be hermetic. - (cd "$APP_DIR" && OS_CLOUD_URL=off nohup ./node_modules/.bin/objectstack dev \ - --seed-admin --fresh -p "$PORT" > "$BACKEND_DIR/backend.log" 2>&1 & \ + # The `cd` runs first and only the `nohup …` command goes to the background, + # so `$!` is the `objectstack dev` process itself (nohup and the bin's + # `env node` shebang both exec in place); its SIGTERM takes down the `serve` + # child that holds the port. Backgrounding `cd … && nohup …` as one list + # forks a subshell and records ITS pid instead: stop-backend.sh then kills + # that subshell and the server keeps the port, and the `already running` + # check above never matches, because the subshell's cmdline is this script's + # (objectui#12676, measured there at 18.0.0-next.2; nothing here re-derives). + (cd "$APP_DIR" + OS_CLOUD_URL=off nohup ./node_modules/.bin/objectstack dev \ + --seed-admin --fresh -p "$PORT" > "$BACKEND_DIR/backend.log" 2>&1 & echo $! > "$BACKEND_DIR/backend.pid") # Ready = the seeded admin can actually sign in (same call the e2e