Skip to content

Test binaries read and write the developer's real ~/.jcode when a test forgets JCODE_HOME #1491

Description

@ianalitis

Problem

jcode_storage::jcode_dir() falls back to ~/.jcode whenever JCODE_HOME is unset, including inside cargo test binaries. Any test that forgets to sandbox writes into the developer's real state.

Reproduction (macOS, origin/master 691c6f5)

  1. Note ls ~/.jcode/active_pids | wc -l and ls ~/.jcode/sessions | wc -l.
  2. cargo test --workspace --lib with JCODE_HOME unset.
  3. Result: 159 new active-pid markers (for example session_existing_live_takeover, session_atomic_target_11) and 103 fixture session files (session_atomic_source_*, Reconnect Takeover Rejected, ...) in the real home; last_seen_changelog rewritten.

Expected

Tests never touch the real ~/.jcode.

History

Per-suite guards keep missing cases: #1487 (copilot), #1489 (communicate), and the fixes for #1133, #1142, #1365. A root fallback in jcode_dir() for test binaries would cover all of them.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions