Skip to content

Tests never reach the machine's default tmux server - #117

Merged
hhff merged 1 commit into
mainfrom
tmux-guard
Nov 6, 2026
Merged

hhff merged 1 commit into
mainfrom
tmux-guard

Conversation

@hhff

@hhff hhff commented Nov 6, 2026

Copy link
Copy Markdown
Member

What

  • test/kit.test.mjs:
    • A tmux shim first on PATH runs the real tmux only while TMUX_TMPDIR is an existing private dt-tmux-* directory, and refuses (exit 1) otherwise.
    • The run's private directory is removed in a process exit handler, after its kill-server, instead of in the "devteam kit" test's t.after.
    • The fleet fixtures' done() kills their own server before removing their directory.

Why

tmux silently falls back to the default server when TMUX_TMPDIR points at a deleted directory. I verified it: TMUX_TMPDIR=<deleted> tmux ls lists the live fleet's session.

The "devteam kit" test's cleanup deleted the private directory, and about 80 later top-level tests call tmux, including kill-server. So running the full suite on a machine with live devteam fleets killed them: stacksbot's fleet was wiped twice today, at 20:40Z and 23:47Z. Thanks to the stacksbot supervisor for the report, and to the test-speed session for finding the mechanism. CI was never affected, since nothing else runs tmux there.

Checked by hand:

  • with a live private directory, the shim passes through to tmux;
  • with a deleted directory, or with TMUX_TMPDIR unset, it refuses;
  • nothing in the kit or the tests calls tmux by an absolute path.

Migration

None. Tests only.

🤖 Generated with Claude Code

tmux falls back to the default server when TMUX_TMPDIR names a directory that
no longer exists. The "devteam kit" test's cleanup removed this run's private
directory, so every later test's tmux call, kill-server included, went to the
default server: running the suite on a machine with live devteam fleets killed
them (stacksbot's, twice today).

- A shim first on PATH runs tmux only while TMUX_TMPDIR is an existing private
  dt-tmux-* directory, and refuses otherwise.
- The run's private directory is removed only at process exit, after its
  server; the fleet fixtures kill their own server before removing theirs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hhff

hhff commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Merging (upstream loop): a test-only safety fix, and CI 18/20/22/24 is green. The shim was checked by hand (it passes with a live private dir, and refuses with a deleted one or none), and nothing calls tmux by an absolute path. The full local suite runs next as part of the v0.20.1 candidate, with this in it.

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.

1 participant