Skip to content

fix(ci): don't fail e2e job when dev server already exited#4054

Draft
aterga wants to merge 1 commit into
mainfrom
claude/fix-e2e-dev-server-cleanup
Draft

fix(ci): don't fail e2e job when dev server already exited#4054
aterga wants to merge 1 commit into
mainfrom
claude/fix-e2e-dev-server-cleanup

Conversation

@aterga

@aterga aterga commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Problem

The e2e-playwright matrix' "Stop dev server" cleanup step runs:

- name: Stop dev server
  if: ${{ always() }}
  run: kill ${{ steps.dev-server-start.outputs.dev_server_pid }}

under bash -e. The dev server is started as a backgrounded npm run dev | tee … & pipeline, and the captured $! PID is frequently already reaped by the time this cleanup step runs. kill then exits non-zero (kill: (NNNN) - No such process), and because the step runs under bash -e, the whole job fails — after every test has already passed.

This produces spurious red e2e shards (observed repeatedly on desktop, 2_6 and mobile, 2_6) on PRs that don't touch any test or app code, e.g. a docs/scripts-only change. Example log tail:

  31 passed (5.4m)
Run kill 3405
kill: (3405) - No such process
##[error]Process completed with exit code 1.

Fix

Make the cleanup non-fatal:

run: kill ${{ steps.dev-server-start.outputs.dev_server_pid }} 2>/dev/null || true

Kill semantics are unchanged — anything still alive is reaped by the runner's orphan-process cleanup (visible as Terminate orphan process: … at job end). The step simply no longer turns a green run red. This is the only kill-based cleanup step in the workflows (verified), so one edit covers all e2e shards.

Testing

  • yaml.safe_load parses the workflow.
  • The change is confined to the cleanup step; it cannot affect test outcomes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CGvgPmEVcgyUP2mAnwnDcj


Generated by Claude Code

The e2e-playwright matrix' "Stop dev server" cleanup step ran
`kill <dev_server_pid>` under `bash -e`. The dev server is launched as a
backgrounded `npm run dev | tee` pipeline, whose `$!` PID is frequently
already reaped by the time cleanup runs — so `kill` exits non-zero with
"No such process" and fails the whole job even though every test passed.
This produced spurious red shards (e.g. desktop/mobile 2_6) on unrelated PRs.

Make the cleanup non-fatal: `kill ... 2>/dev/null || true`. Anything still
alive is reaped by the runner's orphan-process cleanup, so kill semantics are
unchanged — the step just no longer turns a green run red.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CGvgPmEVcgyUP2mAnwnDcj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants