Enable minitest parallelization after thread-safety audit #488
Labels
No labels
P0
P1
P2
P3
bug
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#488
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The os-sdlc suite is fully serial (no parallelize_me!/Minitest.parallel_executor anywhere); dominant cost is subprocess I/O wait, so parallelization should scale near core count (83s → ~15-25s even before tickets 2-3 land). Blocker: with_target_env in tests/test_helper.rb mutates ENV["OS_SDLC_TARGET"] globally, unsafe under concurrency.
Tasks
Acceptance criteria
suite runs parallel and green repeatedly; wall time materially reduced.
Origin
Work started: thread-safety audit + minitest parallelization (batch session 2026-08-23).
Done: minitest parallelization enabled after thread-safety audit. Commit
090c0b1. Wall time 49.1s -> ~13-20s across 5 verification runs (all green). See commit for details; full report in session transcript.Resolution
Done: Thread-safety audit completed and minitest parallelization enabled. Fixed at the root: with_target_env removed from the shared helper (now local to GateCommandsTest), InProcessRunnerCli's global stdout/stderr redirect replaced with a thread-local ThreadRoutedIO, and the process-wide Open3.capture3 monkeypatch replaced with a permanent thread-local seam. Classes touching Dir.chdir/ENV[HOME] run under executor-drain exclusivity (Minitest.run_test_exclusively); 9 classes stay serial.
Evidence: Commit
090c0b1: 12 test files, no lib/ changes. Agent's 5 consecutive green runs: 18.0/20.4/16.6/16.9/17.5s. Independent verification run: 1035 runs, 2692 assertions, 0 failures, 18.2s wall at 475% CPU, vs 83s batch baseline. Two diagnosis rounds used within the agreed two-attempt policy, both root-caused (Dir.chdir concurrent-block crash, Open3 stub cross-thread contamination). No net-new rubocop offenses.Follow-ups: Dropped: re-parallelizing the 9 serial classes — suite is at ~17s, further work is speculative optimization. Dropped: giving RecordingOpen3's status struct a success? method — speculative hardening, fails loudly if ever hit. Dropped: moving ThreadRoutedIO/Open3 seams out of test_helper.rb — style preference with no observed cost.