Skip to content

test(link): verify activity-holds crash points portably on Windows - #8669

Merged
lidge-jun merged 3 commits into
devfrom
fix/dev-red2-link-windows-a
Nov 13, 2026
Merged

lidge-jun merged 3 commits into
devfrom
fix/dev-red2-link-windows-a

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

windows 10/14 of dev batch run 43369456647 failed the four tests/clients/link-ws-activity-holds.test.ts "crash points (SIGKILL)" cases at line 177. The cases came from #8593 (7e3cefd162). The child fixture kills itself with SIGKILL and the test asserted child.signalCode === "SIGKILL". Windows has no signals: the same kill is TerminateProcess, reported as a nonzero exit code with signalCode: null, which is what the log shows. #8628 (which moved the syncDir seam) is not involved, since this fixture supplies no syncDir hook.

The fixture now writes the crash point it reached to stdout just before killing itself, and the test asserts it. A child that never reaches its point now fails explicitly instead of looking like a crash. The kill stays abrupt on every platform; it is never an orderly process.exit, which would run exit handlers a crash skips. An exit handler in the fixture writes a sentinel that only an orderly exit can produce. The test asserts stdout is exactly the crash point, which proves the child died abruptly on every platform: replacing the kill with an error exit fails all four cases. The termination assertion is also platform-aware: SIGKILL on POSIX, a null signal and a nonzero exit code on Windows. Recovery expectations are unchanged.

Verification

  • Windows simulated on Linux with process.platform set to win32 and signalCode reported as null: on dev, the four cases fail with signalCode: null; with this change, 4 pass.
  • bun test tests/clients/link-ws-activity-holds.test.ts tests/clients/link-ws-activity-holds-operator.test.ts: 40 pass, 0 fail. bun run typecheck: exit 0.
  • NOT RUN: a native Windows runner (next dev batch), and the full suite.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Tests
    • Improved validation of abrupt-termination scenarios by confirming each test reaches its intended stopping point and exits as expected across platforms.
    • Added checks to detect unexpected orderly exits, while preserving the existing recovery assertions.

process.exit runs exit handlers a crash skips; keep process.kill(SIGKILL) everywhere (TerminateProcess on Windows) and assert Windows' report of it, a null signal and a nonzero exit code.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 13, 2026 07:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T07:37:31.816851Z 7d7a01e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Nov 13, 2026
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The crash fixture now writes the name of each reached crash point to stdout before attempting termination. The test captures that output, checks it against the requested point, and verifies the platform-specific process exit result.

Changes: Crash-point test reporting

Layer / File(s) Summary
Report and verify crash points
tests/fixtures/link-ws-holds-crash.ts, tests/clients/link-ws-activity-holds.test.ts
The fixture writes the reached point name before sending SIGKILL and throws if termination returns or no point is reached. The test checks the reported name and verifies SIGKILL off Windows, or a null signal and nonzero exit code on Windows.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: Minimal · up to eddc7

This change only updates a crash-point test and its fixture so the test works on Windows. It does not change production behavior, and no actionable merge-blocking risk remains.

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(link): verify activity-holds crash points portably on Windows" matches the main change. The PR updates the abrupt-termination test in tests/clients/link-ws-activity-holds.test.ts and t…
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(link): verify activity-holds crash points portably on Windows" matches the main change. The PR updates the abrupt-termination test in tests/clients/link-ws-activity-holds.test.ts and the fixture tests/fixtures/link-ws-holds-crash.ts. The fixture now prints each reached crash point before SIGKILL, and the test checks stdout and the platform-specific exit signature. The title is specific, short, and states the purpose and scope of the change.

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

Commits

Reviewing files that changed from the base of the PR and between 7d7a01e and eddc782.

Files selected for processing: 2

  • tests/clients/link-ws-activity-holds.test.ts
  • tests/fixtures/link-ws-holds-crash.ts

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

Review of #8669: on Windows a marker plus a nonzero exit cannot tell an abrupt kill from an error exit. The fixture registers an exit handler that writes a sentinel; an abrupt kill never runs it, and the test asserts stdout is exactly the crash point on every platform. Replacing the kill with an error exit fails all four cases.
@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer judgment (dev integration, MAINTAINERS.md maintainer-integration exception): merging without a second maintainer approval, as part of the DEV-RED repair for dev batch run 43369456647 (windows 10/14).

  • Exact head: eddc7822f87d6cc740a8f92c111064e3be1f4b60. Every required PR check on this head passed.
  • Fresh independent review on this exact head (gpt-6.1-terra, high): VERDICT: PASS, no findings, after an earlier round whose finding (an abrupt kill vs an orderly error exit on Windows) was addressed with an exit-handler sentinel. Its fresh runs: activity-holds files 40 pass / 0 fail; the mutation from kill to exit fails all four cases; typecheck, ratchet, structure:check and privacy:scan pass.
  • Classification: test-assumption bug from feat(link): the Home accepts the Responses WebSocket over a Remote Link, behind a closed release gate #8593 (SIGKILL is reported as signalCode null + nonzero exit on Windows); not caused by test(link): run the activity-holds directory-sync seam on Windows too #8628. Test-only; recovery assertions unchanged.
  • No outstanding change requests. Not yet verified on a native Windows runner; the maintainer's next dev batch covers it.

@lidge-jun
lidge-jun merged commit 3f5530b into dev Nov 13, 2026
36 of 39 checks passed
@lidge-jun
lidge-jun deleted the fix/dev-red2-link-windows-a branch November 13, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant