QA orchestrator: trap/cleanup for background Vite in start-qa-local-full-stack.sh (151-2) #153
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#153
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
scripts/start-qa-local-full-stack.shfunctionstart_frontend_devbackgroundsnpm run dev(Vite), writes PID to/tmp/yieldomega_frontend_qa.pid, but installs notraponEXIT/INT/TERMto tear down that child when the orchestrator exits or is Ctrl-C’d.Impact: If the script dies after Vite starts (or the user interrupts mid–readiness loop), the Vite process can orphan and keep binding
FRONTEND_DEV_PORT(default 5173). The next run may either fail to bind (loud) or, worse, pass thecurlreadiness probe against a stale server from a previous run — the reviewer in #151 observed the same class of bug with Anvil on 8545; the shape matches Vite here.Split from GitLab #151 (Finding 2 — Low). Parent orchestrator story: GitLab #104.
Related code & docs
scripts/start-qa-local-full-stack.sh—start_frontend_dev(~lines 92–131): background subshell + PID file, no trapscripts/start-local-anvil-stack.shdocs/testing/qa-local-full-stack.md— GitLab #104docs/testing/invariants-and-business-logic.md— QA full stack / #104.cursor/skills/yieldomega-guardrails/SKILL.md(item 36)docs/testing/manual-qa-checklists.md— #104 if presentContracts / indexer: Not applicable.
Acceptance criteria
start_frontend_devlaunches Vite, atrap(or equivalent) runs onEXIT,INT, andTERMthat kills the recorded Vite PID (from the pid file or the background job’s$!) and avoids double-kill / noisy errors (|| truewhere appropriate).--no-frontend: No regression — no Vite process, no spurious trap firing.Verification checklist
bash scripts/start-qa-local-full-stack.sh(default, with frontend) → browser loadshttp://127.0.0.1:5173→ quit script via documented “stopping” flow inqa-local-full-stack.md→ no straynode/vitelistening on 5173 (ss -ltnp | grep 5173or equivalent).--no-frontend:bash scripts/start-qa-local-full-stack.sh --no-frontend→ no/tmp/yieldomega_frontend_qa.pidhot-leak from this change (n/a if Vite not started).docs/testing/qa-local-full-stack.mdStopping the stack if trap changes how operators should stop Vite.--helpbehavior: no regression tousage()/ banner-only help.marked this issue as related to #151
mentioned in issue #151
marked this issue as related to #104
marked this issue as related to #105
mentioned in commit
3b3bd0c6c5Implemented GitLab #153 on
main(commit3b3bd0c).Summary
scripts/lib/qa_local_full_stack_frontend.sh:start_frontend_devarms INT/TERM + EXIT traps during the readiness loop only. INT/TERM disarms traps first, kills the PID from the pid file, thenexit 130so bash does not resume a blocking loop after the trap (critical for Ctrl+C). EXIT covers errexit without clobbering exit codes.exec npminside the subshell so$!is the Node/Vite process. Readinesscurluses--connect-timeout 1 --max-time 3. If the probe never succeeds in ~30s, the script kills Vite, removes the pid file, andexit 1(fail-closed vs leaving a wedged server).scripts/start-qa-local-full-stack.sh: sources the lib module; **--help/ #105unchanged** (verified: noset -euo pipefail` in usage output).scripts/verify-qa-orchestrator-frontend-trap.sh: hermetic smoke (no Docker/Anvil). Optional overrideQA_FRONTEND_PID_FILEfor tests.docs/testing/qa-local-full-stack.md,invariants-and-business-logic.md(INV-QA-FULLSTACK-153+ §153),manual-qa-checklists.md,e2e-anvil.md,skills/README.md,skills/script-with-timecurve-local/SKILL.md,.cursor/skills/yieldomega-guardrails/SKILL.md.Verification checklist for @brouie
bash scripts/start-qa-local-full-stack.sh --help— still no shell setup lines (set -euo pipefail, etc.).bash scripts/verify-qa-orchestrator-frontend-trap.sh— printsOK:and exits 0.http://127.0.0.1:5173→ Ctrl+C during readiness (or right after Vite PID logged) →ss -ltnp(orlsof -i :5173) shows no stray listener on the dev port.--no-frontend: no regression; no Vite pid file from this path.Issue left open for your sign-off. Thanks!
@PlasticDigits — verification PASS on
3b3bd0c.ran your hermetic verify script:
result:
OK: verify-qa-orchestrator-frontend-trap (signal trap exits + _qa_kill_pid_file_process).trap fires on interrupt-before-ready, kill + exit path executes cleanly. INV-QA-FULLSTACK-153 satisfied.
ready for close on your side.
mentioned in commit
ed51a62362