Replace the NCPU and PROCMAN_REAL test ENV reads with defaults and explicit parameters #818

Closed
opened 2026-09-28 21:49:49 +00:00 by jared · 3 comments
Owner

Problem

The os-sdlc tests read two environment variables to change their behavior. The rule is that only bin/ entry scripts read ENV, and other code receives values as arguments. The defaults are already correct: without the variables, tests run in parallel and the real-daemon tests skip. A non-default choice must come from an explicit parameter, not from the environment.

plugins/os-sdlc/tests/test_helper.rb:4:  require "minitest/parallel_fork" unless ENV["NCPU"] == "1"
plugins/os-sdlc/tests/adapter/probe/lsp_integration_test.rb:12:  skip "requires PROCMAN_REAL=1" unless ENV["PROCMAN_REAL"] == "1"
plugins/os-sdlc/tests/adapter/probe/lsp_probe_bin_test.rb:13:  skip "requires PROCMAN_REAL=1" unless ENV["PROCMAN_REAL"] == "1"

OS_SDLC_SUITE_BUDGET_S was removed for the same reason on 2026-09-28 (main e122af18).

Reproduce

n/a: design ticket.

Origin

  • Trigger: user review of ENV reads outside bin/ after OS_SDLC_SUITE_BUDGET_S was removed
  • Improvised this session: none
  • Chain: tests change behavior from ENV <- test runner has no parameter for serial runs or real-daemon tests <- DESIGN (.claude/rules/os-sdlc-architecture.md "Entry points own the environment")
  • Root candidate: this ticket
  • Where: plugins/os-sdlc/tests/test_helper.rb, plugins/os-sdlc/tests/adapter/probe/lsp_integration_test.rb, plugins/os-sdlc/tests/adapter/probe/lsp_probe_bin_test.rb
  • Session: 47a537c2-08a1-4d3c-9688-75df56dfdd3d
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-ticket-808/47a537c2-08a1-4d3c-9688-75df56dfdd3d.jsonl
## Problem The os-sdlc tests read two environment variables to change their behavior. The rule is that only `bin/` entry scripts read `ENV`, and other code receives values as arguments. The defaults are already correct: without the variables, tests run in parallel and the real-daemon tests skip. A non-default choice must come from an explicit parameter, not from the environment. ``` plugins/os-sdlc/tests/test_helper.rb:4: require "minitest/parallel_fork" unless ENV["NCPU"] == "1" plugins/os-sdlc/tests/adapter/probe/lsp_integration_test.rb:12: skip "requires PROCMAN_REAL=1" unless ENV["PROCMAN_REAL"] == "1" plugins/os-sdlc/tests/adapter/probe/lsp_probe_bin_test.rb:13: skip "requires PROCMAN_REAL=1" unless ENV["PROCMAN_REAL"] == "1" ``` `OS_SDLC_SUITE_BUDGET_S` was removed for the same reason on 2026-09-28 (main e122af18). ## Reproduce n/a: design ticket. ## Origin - Trigger: user review of ENV reads outside `bin/` after `OS_SDLC_SUITE_BUDGET_S` was removed - Improvised this session: none - Chain: tests change behavior from ENV <- test runner has no parameter for serial runs or real-daemon tests <- DESIGN (.claude/rules/os-sdlc-architecture.md "Entry points own the environment") - Root candidate: this ticket - Where: plugins/os-sdlc/tests/test_helper.rb, plugins/os-sdlc/tests/adapter/probe/lsp_integration_test.rb, plugins/os-sdlc/tests/adapter/probe/lsp_probe_bin_test.rb - Session: 47a537c2-08a1-4d3c-9688-75df56dfdd3d - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-ticket-808/47a537c2-08a1-4d3c-9688-75df56dfdd3d.jsonl
Author
Owner

Triage 2026-09-29 (main bf926443): verdict still valid, not fixed by #819-#821 (those touched the required-work gate only). ENV reads still at tests/test_helper.rb:4, adapter/probe/lsp_integration_test.rb:12, adapter/probe/lsp_probe_bin_test.rb:13.

Readiness: ready-for-human, not ready-for-agent. The ticket states the problem but not the replacement. Open decisions: (1) how a serial run is chosen without ENV; minitest-parallel_fork also reads NCPU inside the gem, so the choice may have to live in the runner bin or a Rake task argument. (2) how the two real-daemon tests are opted in; they need an explicit runner parameter or a separate test entry point. (3) ADR-0219 item 10 names PROCMAN_REAL=1 as the opt-in and ADR-0242 mentions NCPU=12, so an amending or superseding ADR is needed first.

Relationships: no blocker or duplicate among #802, #805, #806, #811, #812. Only shared surface is os-sdlc tests. Labels added: update, ready-for-human. next not touched. Ticket left open.

Triage 2026-09-29 (main bf926443): verdict still valid, not fixed by #819-#821 (those touched the required-work gate only). ENV reads still at tests/test_helper.rb:4, adapter/probe/lsp_integration_test.rb:12, adapter/probe/lsp_probe_bin_test.rb:13. Readiness: ready-for-human, not ready-for-agent. The ticket states the problem but not the replacement. Open decisions: (1) how a serial run is chosen without ENV; minitest-parallel_fork also reads NCPU inside the gem, so the choice may have to live in the runner bin or a Rake task argument. (2) how the two real-daemon tests are opted in; they need an explicit runner parameter or a separate test entry point. (3) ADR-0219 item 10 names PROCMAN_REAL=1 as the opt-in and ADR-0242 mentions NCPU=12, so an amending or superseding ADR is needed first. Relationships: no blocker or duplicate among #802, #805, #806, #811, #812. Only shared surface is os-sdlc tests. Labels added: update, ready-for-human. next not touched. Ticket left open.
Author
Owner

Work started 2026-09-30 on main. Decisions (user): worker count = [Etc.nprocessors - 4, 1].max through a Minitest.parallel_fork_number override in test_helper.rb (8 workers on a 12-CPU machine, ~12s vs ~20s at 4); NCPU check removed. Both real-daemon tests (lsp_integration_test.rb, lsp_probe_bin_test.rb) deleted with their PROCMAN_REAL opt-in; ADR amends ADR-0219 item 10. ADR-0242 is superseded by 0224, so no amendment needed.

Work started 2026-09-30 on main. Decisions (user): worker count = [Etc.nprocessors - 4, 1].max through a Minitest.parallel_fork_number override in test_helper.rb (8 workers on a 12-CPU machine, ~12s vs ~20s at 4); NCPU check removed. Both real-daemon tests (lsp_integration_test.rb, lsp_probe_bin_test.rb) deleted with their PROCMAN_REAL opt-in; ADR amends ADR-0219 item 10. ADR-0242 is superseded by 0224, so no amendment needed.
Author
Owner

Resolution

Done: test_helper always loads minitest/parallel_fork and defines Minitest.parallel_fork_number as [Etc.nprocessors - 4, 1].max (8 workers on 12 CPUs); the NCPU check is removed. lsp_integration_test.rb, lsp_probe_bin_test.rb and their two support files are deleted with the PROCMAN_REAL opt-in. ADR-0254 amends ADR-0219 item 10. No test code reads ENV now.

Evidence: main 49834f58. Suite: 1328 runs, 2954 assertions, 0 failures, 0 errors, 0 skips, 15.8s. Minitest.parallel_fork_number = 8. Timings before the change: 1 worker 44.0s, 4 workers 18-24s, 8 workers 11.8-12.6s, 12 workers 10.9s.

Follow-ups: Dropped: docs/crc/os-sdlc/lens-audit/tests.md:24-25 and docs/crc/os-sdlc/HANDOFF.md:184 name the deleted tests; both are dated audit records, so they stay unchanged.

## Resolution **Done:** test_helper always loads minitest/parallel_fork and defines Minitest.parallel_fork_number as [Etc.nprocessors - 4, 1].max (8 workers on 12 CPUs); the NCPU check is removed. lsp_integration_test.rb, lsp_probe_bin_test.rb and their two support files are deleted with the PROCMAN_REAL opt-in. ADR-0254 amends ADR-0219 item 10. No test code reads ENV now. **Evidence:** main 49834f58. Suite: 1328 runs, 2954 assertions, 0 failures, 0 errors, 0 skips, 15.8s. Minitest.parallel_fork_number = 8. Timings before the change: 1 worker 44.0s, 4 workers 18-24s, 8 workers 11.8-12.6s, 12 workers 10.9s. **Follow-ups:** Dropped: docs/crc/os-sdlc/lens-audit/tests.md:24-25 and docs/crc/os-sdlc/HANDOFF.md:184 name the deleted tests; both are dated audit records, so they stay unchanged.
jared closed this issue 2026-09-30 14:51:17 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#818
No description provided.