Skip to content

3054 supervisor child-exit test flakes: "waits for the actual child exit observation" resolves instead of rejecting #4242

Closed

Description

@code-yeongyu

packages/coding-agent/test/suite/regressions/3054-supervisor-child-exit.test.ts > "waits for the actual child exit observation before releasing its generation" fails intermittently: the promise it expects to reject resolves instead.

Occurrences (two different machines):

Both PRs are unrelated to the supervisor, so this is a test or race defect, not a regression from those changes.

Hypothesis: the test (or the supervisor path it covers) decides the outcome from timing, so on a loaded runner the generation is released before, or without, the child-exit observation the test is waiting to see. A test that passes or fails on timing is a bug.

Expected: the test subscribes to the exact child-exit event (and the supervisor's generation-release signal) before triggering the exit, then awaits those events in order with a bounded timeout, with no fixed waits. If the supervisor can actually release a generation before it observes the child's exit, that is a product bug to fix in the supervisor, not in the test.

Related: #4216 tracks a different failure in the same file (the fixture never reaches host-ready natively; exit 1 vs 143 in the Linux container).

Activity

  1. code-yeongyu commented on Oct 27, 2026

    @code-yeongyu
    OwnerAuthor

    Another occurrence on the 'macOS combined' check (macos-26-arm64 hosted runner) for #4374 at 6e92045: test/suite/regressions/3054-supervisor-child-exit.test.ts > supervisor child exit > waits for the actual child exit observation before releasing its generation: "promise resolved "undefined" instead of rejecting" at :296. #4374 does not touch supervisor/host-lifetime code; the same head passed 23,701/23,701 tests locally. Job: https://github.com/code-yeongyu/senpi/actions/runs/40431984015/job/121951674535

  2. code-yeongyu commented on Oct 27, 2026

    @code-yeongyu
    OwnerAuthor

    Fixed by #4273 (merge commit 0c67f6b).

    Root cause and fix: the supervisor's ensureHost treated a host whose child had exited but whose socket file remained as alive, and the startup stop path raced the drain watch; the fix makes ensureHost prove a dead socket itself and gates the stop on the host's own startup event, and the regression tests subscribe to the exact event before triggering (no sleeps, retries or longer timeouts).

    Evidence at the merged head 5a39b31: review CLEAR (3054 test fold: ensureHost proves the dead socket itself, mutant run fails, 10/10 repeated runs pass); the 3054/4216/1370 regressions 17/17; CI green at the head (41 pass, 0 fail); merge-gate dry run MERGE_OK_DRY.

  3. added a commit that references this issue on Oct 27, 2026
    508c7e9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions