Skip to content

fix: arm the forced exit before terminate and make heartbeat tests clock-driven - #71

Merged
scttbnsn merged 1 commit into
dev/m2from
fix/heartbeat-tests-quit-order
Nov 3, 2026
Merged

scttbnsn merged 1 commit into
dev/m2from
fix/heartbeat-tests-quit-order

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Two fixes from the beta.9 promotion (#68):

  • PackageQuit armed its 5-second forced exit after calling terminate(). With .terminateLater, AppKit runs a modal loop and terminate() may not return, so the fallback never started. The deadline is now armed first. A new test blocks terminate and checks the forced exit still fires. CodeRabbit flagged this.
  • Two ClosedLidHeartbeatTests cases failed on a loaded macOS 26 runner (run 41555986220). They used short real-time windows, so a slow runner made the heartbeat look stalled. ClosedLidWatchdog now takes an injected monotonic clock and poll ticker, and those tests advance a manual clock and fire each poll by hand. Production defaults are unchanged. The SIGSTOP test keeps real time with wider margins.

The targeted suites passed 10 runs in a row with four yes processes loading the CPU, and scripts/verify.sh passes.

…k and arm forced exit before terminate

The heartbeat tests relied on real wall-clock lease and poll intervals and
flaked on a loaded runner. The watchdog now takes a monotonic clock and a
poll ticker (defaults unchanged), so tests advance time and heartbeats in
lockstep. PackageQuit schedules its forced exit before calling terminate(),
which may not return under terminateLater.
@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 16b6aba3-cf3a-472b-b884-9f50faeee20c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttbnsn
scttbnsn merged commit f119daa into dev/m2 Nov 3, 2026
3 of 4 checks passed
@scttbnsn
scttbnsn deleted the fix/heartbeat-tests-quit-order branch November 3, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant