Skip to content

knowledge: SIGINT to a shell-backgrounded process under test is discarded — deliver via subprocess driver (1 ingested, 2 dropped as in-flight dups of #51) - #57

Open
choiyounggi wants to merge 1 commit into
mainfrom
knowledge/choiyounggi-20260807-163902
Open

knowledge: SIGINT to a shell-backgrounded process under test is discarded — deliver via subprocess driver (1 ingested, 2 dropped as in-flight dups of #51)#57
choiyounggi wants to merge 1 commit into
mainfrom
knowledge/choiyounggi-20260807-163902

Conversation

@choiyounggi

Copy link
Copy Markdown
Owner

Knowledge flush — 3 insight(s): 1 ingested, 2 dropped as in-flight duplicates

Verified best-practice

1. SIGINT delivery to &-backgrounded processes in non-interactive shells (INGESTED)

Claim: a test harness that starts a program with cmd & from a shell script and
sends kill -INT "$pid" never delivers an effective SIGINT — POSIX requires
job-control-disabled shells to start asynchronous-list commands with SIGINT and
SIGQUIT set to SIG_IGN, so the kill succeeds and the child discards the signal;
wait then hangs to the harness timeout and the failure reads like a product
bug. Deliver the signal from a subprocess driver instead (e.g.
subprocess.Popen + send_signal(SIGINT)), or set -m in the script, or use
SIGTERM when the contract is generic shutdown.

Sources checked:

Local reproduction (2026-08-07, macOS): sh|bash|zsh -c '<print SIGINT disposition> & wait' all report SIG_IGN for the background child and the
default handler in the foreground; with set -m the background child reports
the default handler; SIGTERM reports SIG_DFL in both. Matches the harvested
field case (server binary: rc 143 timeout under kill -INT+wait, immediate
rc 0 under Popen+send_signal).

Confidence: verified.

2. worktree_escape guardrail escalation budgeting (DROPPED — in-flight duplicate)

Claim: the worktree_escape guardrail escalates read-shaped cross-worktree
access, so orchestration briefs referencing other worktrees must budget the
escalation round trip. Not re-verified here — open PR #51 already carries this
exact insight with a stronger local reproduction (see Open-PR check).

3. Orca terminal bind-failure stage branching (DROPPED — in-flight duplicate)

Claim: check for the idle prompt before binding the next unit to a worker's
terminal; branch on the failure stage (runtime_unavailable → wait and rebind,
agent_unconfigured → replace the agent; always pass --worktree with
--terminal). Not re-verified here — open PR #51 already carries all four rows
with the same field evidence.

Existing-layer check

Routed via INDEX.md → testing domain. Read the full testing domain index (all
"load when" lines) — no existing page covers signal delivery or process
lifecycle in tests; nearest neighbors (diagnosing-flaky-tests, async-testing,
test-level-choice) have non-overlapping triggers. Checked platforms as the
alternative home: background-services covers process persistence (nohup/launchd/
systemd), non-interactive-cli-invocation covers prompt-capable CLIs hanging —
neither covers signal dispositions of & jobs, so this is a new trigger →
new page (merge-before-create satisfied: nothing to merge into). Repo-wide
grep -ril sigint wiki/ confirmed no page mentions the mechanism.

Created: wiki/testing/strategy/signal-delivery-to-a-process-under-test.md
(confidence verified, 3 sources + local repro). Updated wiki/testing/index.md
(strategy table row) and log.md. Related-links added both ways with
platforms-processes-non-interactive-cli-invocation (same interactive-vs-
automation divergence family). No conflicts with existing directives.

Pages read: platforms-processes-background-services, platforms-processes-non-interactive-cli-invocation, infrastructure-agent-orchestration-pane-delivery-confirmation, infrastructure-agent-orchestration-worktree-isolated-workers

Open-PR check

Open knowledge/* heads listed via gh pr list and each diffed against main
(git diff origin/main origin/<head> -- wiki/; fork heads #52/#49 fetched via
pull/<n>/head):

Verdicts: candidate 1 → new (ingested here); candidate 2 → drop
(pending duplicate of #51, nothing unique to fold); candidate 3 → drop
(pending duplicate of #51, nothing unique to fold). No sibling duplicate PR
opened.

Routing decision

  • Candidate 1 → testing/strategy/signal-delivery-to-a-process-under-test.
    Domain: the trigger is test-harness-shaped (harvester hint: testing) and the
    testing INDEX line "writing or structuring automated tests" matches; category
    strategy because the directive chooses the harness/driver structure, not an
    assertion. No new category needed. The shell mechanism is cross-referenced to
    platforms via the related-link rather than a second page (one case, one page).
  • Candidates 2–3 → no routing; retired as pending duplicates of open PR knowledge: 9 insights — closed value table widening, guardrail read-vs-write correction, dispatch binding taxonomy #51.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-loop:knowledge Auto-opened wiki knowledge ingest PR (owner reviews & merges)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant