Skip to content

test: wait for fixture close and descendant readiness - #4197

Merged
mvschwarz merged 1 commit into
mainfrom
test/macos-daemon-process-flakes
Nov 30, 2026
Merged

mvschwarz merged 1 commit into
mainfrom
test/macos-daemon-process-flakes

Conversation

@mvschwarz

@mvschwarz mvschwarz commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Reduce unrelated daemon-test failures on busy runners without relaxing cleanup checks.

  • dsh teardown skips stale process-group signals after child close and accepts EPERM only with bounded close proof.
  • The descendant test fires the existing timeout after both descendants are live; the real-clock timeout tests stay unchanged.
  • A failing two-instance tmux test adds bounded pane, sidecar and daemon-log evidence. Its original failure's cause remains unclassified; the test still fails without retrying.

Validation: all three files passed on Linux with tmux 3.7c (92 tests, zero skips); full build passed. The old teardown fails three new controls, delayed producer startup fails the old test and passes the new one, and an intentional tmux assertion failure stays failed with both fixtures' evidence. macOS qualification remains for this PR's checks.

Summary by CodeRabbit

  • Tests
    • Expanded automated coverage for runner-process cleanup, including already-closed processes and delayed shutdown cases.
    • Improved timeout checks to verify that child processes are stopped after a step fails.
    • Added clearer failure details for isolated two-instance scenarios and checks that each instance is ready before routing and shutdown are tested.
    • Reduced the maximum duration of the two-instance integration test.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The daemon test changes update runner-process teardown, staging invoker timeout checks, and two-instance tmux test diagnostics and readiness checks.

Changes: Runner process teardown

Layer / File(s) Summary
Runner teardown and validation
packages/daemon/test/community-harness-dsh-example.test.ts
The fixture uses a helper to signal the runner process group and wait for child closure before removing the fixture directory. Tests cover already-closed children, EPERM followed by closure, and timeout behavior.

Staging invoker timeout

Layer / File(s) Summary
Timeout control and descendant cleanup
packages/daemon/test/staging-docker-invoker.test.ts
The test holds the step's 300 ms timer until both descendants start, then triggers it and checks the failed result and cleanup. Its finalizer triggers the timeout if needed, awaits the step, restores the spy, and reaps survivors.

Two-instance tmux integration test

Layer / File(s) Summary
Fixture diagnostics and control-client readiness
packages/daemon/test/tmux-server-two-instances.test.ts
The test gathers bounded fixture evidence for failures and waits for one control session on each isolated server before continuing with routing and shutdown assertions. The timeout changes from 360 to 120 seconds.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Suggested reviewers: sn1thy, aschenbath, openrig-review

Merge Risk: Minimal · up to 33c89

This PR changes only daemon test code: process teardown, timeout control, and failure diagnostics. It does not affect production behavior, and no concrete merge-blocking problem was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test: wait for fixture close and descendant readiness" matches the main change. The PR changes daemon test fixtures so they wait for the child process to close and for descendant processes …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test: wait for fixture close and descendant readiness" matches the main change. The PR changes daemon test fixtures so they wait for the child process to close and for descendant processes to be live before the timeout fires. It also covers the dsh teardown and the tmux test evidence capture, which the title does not mention. The title is concise, specific, and uses a conventional commit prefix. Its scope is slightly narrower than the full changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 158f2602-59e9-4360-959d-3828c6665793
Commits

Reviewing files that changed from the base of the PR and between aee5f5c and 33c8909.

Files selected for processing: 3

  • packages/daemon/test/community-harness-dsh-example.test.ts
  • packages/daemon/test/staging-docker-invoker.test.ts
  • packages/daemon/test/tmux-server-two-instances.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@openrig-review openrig-review left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the reviewed head 33c8909 to start the macOS package tests. Test-only: the dsh fixture's teardown waits for the runner to close before it accepts a permission error, the staging timeout test fires only after both descendants are running, and the tmux two-instance test records pane, capture and log evidence when it fails.

@mvschwarz mvschwarz moved this to In Progress in OpenRig roadmap Nov 30, 2026
@mvschwarz
mvschwarz merged commit eea61bf into main Nov 30, 2026
17 checks passed
@mvschwarz
mvschwarz deleted the test/macos-daemon-process-flakes branch November 30, 2026 02:40
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRig roadmap Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants