Skip to content

Clean up Factory skills after unit tests finish - #1930

Merged
JacobStephens2 merged 2 commits into
mainfrom
issue-1913
Nov 10, 2026
Merged

JacobStephens2 merged 2 commits into
mainfrom
issue-1913

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

A completed unit-test process left its Factory skills extraction in TMPDIR because static values are not dropped at process exit.

unit-test users acquire a shared cleanup guard
  → share the process's Factory skills extraction
  → last guard removes it
Command → existing finish cleanup

Closes #1913

Test seams: the existing Session subprocess entry point with a private TMPDIR; public Factory skills linking across overlapping test users; an ordinary Run through Scenario with its private TMPDIR.

Evidence

Execution evidence

  • Before: cargo test --bin thirdshift session::execution_tests::session_subprocess_removes_its_factory_skills -- --exact --nocapture failed with Factory skills left behind: ["thirdshift-skills-acWAv6"] (0 passed; 1 failed).
    After: the same command passed (1 passed; 0 failed).
  • The original reproduction ran the existing review-report Session fixture under a private TMPDIR: it passed but left 7 extractions before the fix (one per current Harness), and left 0 after it.
  • cargo test --bin thirdshift skills::tests -- --nocapture: 6 passed, including overlapping users retaining one extraction until the last finishes. cargo fmt --check passed.
  • Unit binary in one process, with a private TMPDIR, --test-threads=3: 1,684 passed, 3 ignored; 0 Factory skills entries left (666.79 seconds, execution only).
  • All 15 tests named in Unit tests leave 24 Factory skills directories in the temp directory on every run #1913, each in its own process with a new private TMPDIR: passed; 0 Factory skills entries left by each.
  • Validation uses a private HOME and the installed CARGO_HOME/RUSTUP_HOME. An initial run inherited the operator's admission limits; its toolchain fixture also needed RUSTUP_HOME set. That fixture passes with the installed root, and the full unit rerun above passes.
  • Full Rust check: CI cargo nextest run passed on exact head ded15db6eb0d1992c8bd5262624963a23115a545: 3,960 passed, 92 skipped. Test execution took 1,297.727 seconds, plus 73 seconds of compilation (about 1,372 seconds for the command including compilation).
  • scripts/affected-tests main selected that same full Rust suite locally. After CI passed the exact head, the duplicate local run was intentionally stopped, following docs/testing.md's CI-reuse guidance. Its /usr/bin/time -p wall time was 1,681.56 seconds including cached compilation; this interrupted run is not reported as a local pass.

Integration TMPDIR inventory

Each built test binary ran with --test-threads=3 and a fresh private TMPDIR (python3 /tmp/issue-1913-validation.py integrations). All 23 exited successfully.

Binary Factory skills entries left
security_review 0
security_run 0
session_traces 0
setup 0
setup_lifetime 0
setup_offer 0
share_card 0
show_logs 0
site_deploy 0
skill 0
spec_1796 0
spec_push_race 0
spec_review_706_regressions 0
spec_run 0
standards_1795 0
status 0
stop 0
toolchain 0
triage_run 0
trial 0
trial_scope 0
update 0
user_config 0

Unaddressed findings

Standards

None. The Standards reviewer raised 0 findings.

Spec

None. The Spec reviewer raised 0 findings.

Security

None. The Security review found no unaddressed introduced findings.

Security review outcome

No unaddressed introduced findings.

Review coverage

Both independent reviewers read all six changed files: src/skills.rs, src/skills/testing.rs, src/skills/tests.rs, src/session/execution_tests.rs, src/session/private/tests.rs, and tests/fresh_run.rs. Unread changed files: none. Generated-output exclusions: none.

Merge Danger

Door: two-way

Blast Radius: tests

Built with codex codex-cli 0.164.0 · gpt-6.1-sol · xhigh

@JacobStephens2
JacobStephens2 merged commit a95f5a6 into main Nov 10, 2026
16 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1913 branch November 10, 2026 03:06
@JacobStephens2 JacobStephens2 mentioned this pull request Nov 10, 2026
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.

Unit tests leave 24 Factory skills directories in the temp directory on every run

1 participant