Skip to content

test: assert the macOS watchdog arguments in the managed-grace fallback test - #33322

Merged
bolichen97 merged 1 commit into
mainfrom
fix-macos-watchdog-grace-test
Nov 8, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix-macos-watchdog-grace-test

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Make main's macOS test suite pass again by testing the macOS watchdog call that #21821 added.

test/test_dashboard_server_composition_contract_owners.py::test_the_watchdog_budget_falls_back_to_the_managed_service_grace fails on every macOS run since #21821 (fac223579). Example: https://github.com/kirodotdev/KiroCrew/actions/runs/42498006520/job/128784632708

Why it matters

Any PR that runs the macOS suite goes red on a test it never touched, and main's macOS lane stays broken.

Not a goal

What changed (motivation → approach → change)

Symptom: the test asserts LoopStallWatchdog(dump_file="dump.txt", exit_after=40.0), but on macOS the call also carries loop_major_faults=read_loop_pageins_under_pressure, paging_grace_max=120.0.

Root cause: #21821 made _open_loop_watchdog in src/kiro_crew/dashboard/server_runtime/heartbeat.py take a platform_compat.IS_MACOS branch with those two extra arguments. The test was not updated, and Linux CI never takes that branch.

Change: test-only. The test is parametrized over IS_MACOS (False and True), pins it, and asserts the exact call for each branch. The expected call is built once as a dict so the flake-pattern ratchet's duration-kwarg count does not grow.

Backwards compatibility

Compatible: test-only change; no product code is touched.

Removes nothing: the diff only widens one test to cover both platform branches.

Tests

  • test_the_watchdog_budget_falls_back_to_the_managed_service_grace[linux] locks in the Linux call.
  • test_the_watchdog_budget_falls_back_to_the_managed_service_grace[macos] locks in the macOS call with the page-in reader and PAGING_GRACE_MAX_SECS_MACOS.
  • Red first: with IS_MACOS forced to True, the old assert fails on Linux with the same Actual: mock(..., loop_major_faults=..., paging_grace_max=120.0) seen in the macOS CI job.
  • Local: test/test_dashboard_server_composition_contract_owners.py + test/test_loop_watchdog.py 105 passed, 1 skipped; test/test_flake_pattern_ratchet.py::test_no_changed_file_gains_a_flaky_shape passes; black and isort clean.

Proof: not provable -- test-only change

Manual verification

N/A — the macOS branch is covered by the parametrized case; the ci:macos label runs the real macOS suite on this PR.

Related Issues

Fixes #33311
Refs #21821

Sibling sweep

Swept: git grep -nE "_open_loop_watchdog|"LoopStallWatchdog"" -- test/
Sibling: test/test_loop_stall_dump_loop_thread.py:137 -- not affected -- its _NoAlarmWatchdog forwards **kwargs, so the macOS arguments pass through

Pattern harvest

Not generalizable: one stale assert on a call that gained a platform branch; the parametrized test now covers both branches.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners November 8, 2026 17:13
@iamwhatever
iamwhatever requested a review from Zedmor November 8, 2026 17:13
@iamwhatever iamwhatever added the ci:macos Run the on-demand macOS suite against this PR head label Nov 8, 2026
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 1f095343f4902fb37b9ccd499d7a1e4d646e4d5b touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision 1f095343f4902fb37b9ccd499d7a1e4d646e4d5b ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Does not block merge.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 1f095343f4902fb37b9ccd499d7a1e4d646e4d5b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Test-only fix. The test now covers both platform branches of _open_loop_watchdog, and no product code changes, so there is nothing for this review to block.

[DESIGN-REVIEWED] 1f09534

Description read

[DESCRIPTION-READ] ed919a51e6ba4b8cdff8ea6b327f31fba5fb7982c7204367c8cc5252b88740ed

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 1f095343f4902fb37b9ccd499d7a1e4d646e4d5b — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 1f09534

Verdict parsed from the review's SHA-scoped output markers for commit 1f095343f4902fb37b9ccd499d7a1e4d646e4d5b.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 1f095343f4902fb37b9ccd499d7a1e4d646e4d5b false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 1f095343f4902fb37b9ccd499d7a1e4d646e4d5b and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 1f09534

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 1f095343f4902fb37b9ccd499d7a1e4d646e4d5b false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 8, 2026
…ck test

#21821 made _open_loop_watchdog build the watchdog with the macOS page-in
reader and its shorter paging grace cap when platform_compat.IS_MACOS is
true. The fallback test still asserted the Linux-only call, so it failed
on every macOS run. Run it on both branches and assert each one's call.

Fixes #33311
Refs #21821
@iamwhatever
iamwhatever force-pushed the fix-macos-watchdog-grace-test branch from 8cb8b20 to 1f09534 Compare November 8, 2026 17:45
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 8, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving head 1f09534. The test now runs both branches of _open_loop_watchdog's platform_compat.IS_MACOS split and asserts each call: Linux with dump_file and exit_after only, macOS also with loop_major_faults=read_loop_pageins_under_pressure and paging_grace_max=PAGING_GRACE_MAX_SECS_MACOS, which matches heartbeat.py. All checks pass, including the eight macOS shards.

@bolichen97
bolichen97 merged commit f3cc0cc into main Nov 8, 2026
107 of 115 checks passed
@bolichen97
bolichen97 deleted the fix-macos-watchdog-grace-test branch November 8, 2026 19:05
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:macos Run the on-demand macOS suite against this PR head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS: watchdog grace test fails since #21821 added the macOS page-in reader

2 participants