Run CRC bins in process without a fork (InProcessBin) #1421

Closed
opened 2026-10-27 16:37:32 +00:00 by jared · 2 comments
Owner

Problem

InProcessBin#forked at plugins/os-sdlc/tests/support/in_process_bin.rb:58 forks a process to run CRC bins.
The fork exists because ExpectedConstants leaves loaders behind in the parent process.
Blocked by the ExpectedConstants loader-leak ticket A (see comment).
Removing the fork also lets the #1327 journey tracer see os-sdlc bin calls.

Reproduce

n/a: refactor of test support; the existing tests are the proof.

Approach

Run the CRC bins in process, and delete InProcessBin#forked.

Required work:

  1. Remove the fork path — check: absent def forked in plugins/os-sdlc/tests/support/in_process_bin.rb

Acceptance criteria

  1. Given the change, when plugins/os-sdlc/tests/support/in_process_bin.rb is read, then InProcessBin#forked is gone.
  2. Given the change, when tests/crc/*_bin_test.rb run, then they pass.
  3. Given the change, when the suite runs, then suite time is not worse than before.

Owner sketch

class InProcessBin
  def call(argv)
end

Origin

  • Trigger: comment on #1390.
  • Improvised this session: none
  • Chain: fork in tests ← loaders leak from ExpectedConstants ← DESIGN (ticket A)
  • Root candidate: #1390 (parent)
  • Where: plugins/os-sdlc/tests/support/in_process_bin.rb
  • Session: c843bd27-b3bf-4e36-9243-df1697457146
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/c843bd27-b3bf-4e36-9243-df1697457146.jsonl

References #1390.
VERDICT: CREATE

## Problem `InProcessBin#forked` at `plugins/os-sdlc/tests/support/in_process_bin.rb:58` forks a process to run CRC bins. The fork exists because `ExpectedConstants` leaves loaders behind in the parent process. Blocked by the `ExpectedConstants` loader-leak ticket A (see comment). Removing the fork also lets the #1327 journey tracer see os-sdlc bin calls. ## Reproduce n/a: refactor of test support; the existing tests are the proof. ## Approach Run the CRC bins in process, and delete `InProcessBin#forked`. Required work: 1. Remove the fork path — check: absent `def forked` in `plugins/os-sdlc/tests/support/in_process_bin.rb` ## Acceptance criteria 1. Given the change, when `plugins/os-sdlc/tests/support/in_process_bin.rb` is read, then `InProcessBin#forked` is gone. 2. Given the change, when `tests/crc/*_bin_test.rb` run, then they pass. 3. Given the change, when the suite runs, then suite time is not worse than before. ## Owner sketch ```ruby class InProcessBin def call(argv) end ``` ## Origin - Trigger: comment on #1390. - Improvised this session: none - Chain: fork in tests ← loaders leak from ExpectedConstants ← DESIGN (ticket A) - Root candidate: #1390 (parent) - Where: plugins/os-sdlc/tests/support/in_process_bin.rb - Session: c843bd27-b3bf-4e36-9243-df1697457146 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/c843bd27-b3bf-4e36-9243-df1697457146.jsonl References #1390. VERDICT: CREATE
Author
Owner

Blocked by #1420 (ExpectedConstants leaves loaders registered). Remove the fork only after #1420 lands.

Blocked by #1420 (ExpectedConstants leaves loaders registered). Remove the fork only after #1420 lands.
Author
Owner

Resolution

Done: InProcessBin#forked and its marshal helpers removed; CRC bins run in process. boot restores $stdout/$stderr in ensure and uses block Dir.chdir. tests/in_process_bin_test.rb deleted (covered only fork marshal/child-exit paths). Hand-finished outside the pipeline: a test-only ticket fails at guard-map test-reviewer (#1416).

Evidence: main bb9f1f88. Full os-sdlc suite 2767 runs, 0 failures; wall time 61.6s before, 46.9s after; sqlite fork warnings gone. Every tests/crc/*_bin_test.rb passes. rubocop clean on in_process_bin.rb.

Follow-ups: none

## Resolution **Done:** InProcessBin#forked and its marshal helpers removed; CRC bins run in process. boot restores $stdout/$stderr in ensure and uses block Dir.chdir. tests/in_process_bin_test.rb deleted (covered only fork marshal/child-exit paths). Hand-finished outside the pipeline: a test-only ticket fails at guard-map test-reviewer (#1416). **Evidence:** main bb9f1f88. Full os-sdlc suite 2767 runs, 0 failures; wall time 61.6s before, 46.9s after; sqlite fork warnings gone. Every tests/crc/*_bin_test.rb passes. rubocop clean on in_process_bin.rb. **Follow-ups:** none
jared closed this issue 2026-10-27 16:52:51 +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#1421
No description provided.