Run os-sdlc crc bin tests in-process, not as subprocesses #1329
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
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
rule-proposal
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#1329
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?
Problem
Ten crc test files start our own
crc-*bin scripts with Open3. They make 83 subprocess calls. These calls use 26.5 s of the 29.3 s that these files take. The os-sdlc suite runs 65.8 s against a 60 s budget.Approach
Each file has a private
run_binhelper that callsOpen3.capture2orOpen3.capture3. Replacerun_binwithOsSdlc::Boot.run("<name>", OsSdlc::ProcessIO.new(cwd:, stdin: StringIO.new, stdout: StringIO.new, stderr: StringIO.new, env: {}), argv). Seetests/crc_boot_entry_test.rb:209andtests/system_model_cli_test.rb:129for the pattern. The files arecensus(37 tests),census_since(13),filing(13),inward_delta(10),jobs(13),placement(7),records(39),score(6),sweep(39), andtickets(47). Also converttests/support/crc_census_scenario.rb. Expected saving: about 24 s of wall time.Behavior is unchanged. The existing suite is the proof. Each bin keeps exactly one smoke test, in a file named
<bin>_bin_smoke_test.rb. The smoke test runs the bin as a subprocess to prove the plain-ruby boot (ADR-0166) and the shebang. Calls to external tools (git, rubocop, likec4) stay as subprocess calls. The ADR-0232os-sdlc-<command>contract (stdin, argv, stdout byte-identical; harness errors on stderr with exit 3) must stay asserted by the in-process tests or the smoke tests.Required work:
run_binhelper in eachtests/crc/*_bin_test.rbfile with a call toOsSdlc::Boot.runandOsSdlc::ProcessIO.tests/support/crc_census_scenario.rbto the in-process call.<bin>_bin_smoke_test.rbfile per crc bin that runs the bin as a subprocess with--helpand expects exit 0.Open3from the converted test files — check: absentOpen3inplugins/os-sdlc/tests/crc/*_bin_test.rbAcceptance criteria
*_bin_smoke_test.rbfile starts a pluginbin/script as a subprocess.--help.Owner sketch
OsSdlc::Boot.run(name, io, argv)returns the exit code. The test passes anOsSdlc::ProcessIObuilt fromStringIOobjects and readsstdoutandstderrfrom them.Non-goals
Other os-sdlc spawning tests. Another ticket covers them.
Origin
ruby plugins/os-sdlc/tests/all.rbtook 65.8 s against a 60 s budget. About 70% of summed test time is tests that start our own bin scripts with Open3.jared referenced this issue2026-10-25 19:49:02 +00:00
Work started in /os-sdlc:fast-batch fast-batch-15, branch fast-batch-15.
Resolution
Done: crc bin tests call Boot.run through InProcessBin (forked); one *_bin_smoke_test.rb per crc bin.
Evidence: Finding A
5813d542; fix R18aa1b19e2(InProcessBin error reporting). Suites atc9f5db8f: os-sdlc 2701 runs 0 failures (53.1 s, budget 60 s), os 47, os-backlog 327, os-aidd-lint 491, os-adr 111, os-me 399, cc-architect plugin_config 106, all green. Merged to mainc9f5db8f, pushedbe5d2c5d. Batch state and rulings: docs/crc/os-sdlc/fast-batch-15/.Follow-ups: #1390 (R1: census/score load the target loader, so InProcessBin forks; occurrence posted). #1337 (cop) runs next.