Skip to content

test(mcpx): treat zombies as gone when a script timeout kills its group (#13713) - #13842

Open
dezren39 wants to merge 1 commit into
mainfrom
xaltha/13713-mcpx-scriptview-timeout
Open

dezren39 wants to merge 1 commit into
mainfrom
xaltha/13713-mcpx-scriptview-timeout

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Closes #13713

Summary

TestScriptViewCommandTimeoutKillsSpawnedWorkers polled syscall.Kill(pid, 0) to confirm the spawned worker died. In a container whose PID 1 does not reap orphans the killed worker stays a zombie, and kill(pid, 0) keeps succeeding on a zombie, so the test failed in Fleet executor containers while the group termination itself worked.

The test now polls processExited: /proc/<pid>/stat state Z (linux) or P_stat == SZOMB (darwin) counts as gone, mirroring internal/e2e's exited helper. scriptview.go is unchanged. The helper has its own oracle test: a running child reads alive, a killed-but-unreaped child (zombie) reads exited, a reaped child reads exited.

Evidence

Before (probe branch with the naive signal-0 implementation, same tests): both tests FAIL — https://github.com/developing-today/fleet/actions/runs/45283298540

After (this branch): both tests PASS with -race -count=1 -v, plus scripts/darwin-compile-check.sh — https://github.com/developing-today/fleet/actions/runs/45284483508

  • --- PASS: TestProcessExitedTellsALiveProcessFromAGoneOne (0.05s)
  • --- PASS: TestScriptViewCommandTimeoutKillsSpawnedWorkers (0.34s)

Command: cd pkgs/mcpx && go test ./internal/daemon -run "TestProcessExitedTellsALiveProcessFromAGoneOne|TestScriptViewCommandTimeoutKillsSpawnedWorkers" -race -count=1 -v && bash scripts/darwin-compile-check.sh

Evidence level: verified by remote dispatch on GitHub-hosted runners via the fleet-command.yml fallback (fleet queue dispatch is blocked by TLS defect #13185); not run in a Fleet executor container itself, so the executor-container pass is inferred from the zombie mechanism the oracle test pins, not observed there. Not built or tested locally.

Merge Danger

Test-only change (4 new _test.go files + one poll-loop line in scriptview_test.go). No production code touched. Worst case: a platform where the helper misreads liveness — the linux/darwin paths mirror the proven internal/e2e helper, and the other fallback keeps the old signal-0 behavior.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T23:13:37Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "bbfc8aa3a3b4f3e3d399b7e76beb6962c0daa5b9"
    },
    "auth_subject": "xaltha",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Start Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…up (#13713)

TestScriptViewCommandTimeoutKillsSpawnedWorkers polled syscall.Kill(pid, 0)
to confirm the spawned worker died. In a container whose PID 1 does not
reap orphans the killed worker stays a zombie, and kill(pid, 0) keeps
succeeding on a zombie, so the test failed in Fleet executor containers
while the group termination itself worked.

Poll processExited instead: /proc/<pid>/stat state Z (linux) or
P_stat == SZOMB (darwin) counts as gone, mirroring internal/e2e's
exited helper. scriptview.go is unchanged.

The helper has its own oracle test: a running child reads alive, a
killed-but-unreaped child (zombie) reads exited, a reaped child reads
exited.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 20b9c755-65c4-48df-a893-06cc4b3a25d0
Commits

Reviewing files that changed from the base of the PR and between d0025c8 and 4350044.

Files selected for processing: 5

  • pkgs/mcpx/internal/daemon/process_exited_darwin_test.go
  • pkgs/mcpx/internal/daemon/process_exited_linux_test.go
  • pkgs/mcpx/internal/daemon/process_exited_other_test.go
  • pkgs/mcpx/internal/daemon/process_exited_test.go
  • pkgs/mcpx/internal/daemon/scriptview_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
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.

mcpx: TestScriptViewCommandTimeoutKillsSpawnedWorkers fails in Fleet executor containers

1 participant