Skip to content

fix: reap workspace test tmux after abrupt exits - #1040

Merged
mariusvniekerk merged 1 commit into
mainfrom
fix/workspacetest-tmux-reaping
Sep 4, 2026
Merged

fix: reap workspace test tmux after abrupt exits#1040
mariusvniekerk merged 1 commit into
mainfrom
fix/workspacetest-tmux-reaping

Conversation

@mariusvniekerk

Copy link
Copy Markdown
Collaborator

The split internal/server/workspacetest package keeps one private tmux server for the lifetime of its test binary. A forced exit skips TestMain and signal cleanup, so the server could outlive the test run and consume resources in later runs.

This routes package-level ownership through testtmux.Owner and adds an owner reaper process that cleans registered servers when the parent dies. Normal cleanup stops the reaper, failed cleanup cancels it while preserving stale-owner state, and a regression test kills the owner and observes the server disappear.

The split workspace test package owns one private tmux server for its full
lifetime. A forced test-binary exit skips TestMain and signal cleanup, so that
server could outlive its owner and consume resources in later test runs.

Use the shared tmux owner with a reaper that observes owner death. Failed
cleanup also terminates the reaper while preserving state for the existing
stale-owner recovery path.

Generated with Codex
Co-authored-by: Codex <noreply@openai.com>
@roborev-ci

roborev-ci Bot commented Sep 4, 2026

Copy link
Copy Markdown

roborev: Combined Review (5a31c1c)

Verdict: One medium-severity cleanup leak remains; otherwise, no issues were identified.

Medium

  • internal/testutil/testtmux/owner.go:380 — When cleanup fails, the code kills the reaper even though the owner’s run directory and tmux servers may remain. This can permanently leak tmux servers after TestMain exits. Keep the reaper alive until cleanup fully removes the run and its resources.

Reviewers: 2 done | Synthesis: codex, 6s | Total: 7m16s

@mariusvniekerk
mariusvniekerk merged commit 0a2acfb into main Sep 4, 2026
16 checks passed
@mariusvniekerk
mariusvniekerk deleted the fix/workspacetest-tmux-reaping branch September 4, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant