Skip to content

Reduce macOS CI latency while preserving platform coverage - #3213

Merged
Hillary Mutisya (hillary-mutisya) merged 2 commits into
mainfrom
dev/hillarym/macOsTest
Oct 24, 2026
Merged

Hillary Mutisya (hillary-mutisya) merged 2 commits into
mainfrom
dev/hillarym/macOsTest

Conversation

@hillary-mutisya

@hillary-mutisya Hillary Mutisya (hillary-mutisya) commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Why this change

macOS test jobs have been holding up PR validation for more than an hour, often after the corresponding Ubuntu and Windows jobs have finished. We reviewed five recent completed PRs to separate slow initial execution from time spent retrying failures.

The table shows median Test-step duration in minutes, including retries, across each PR's configured Node versions. It does not include installation or build time.

PR / workflow run macOS Ubuntu Windows
#3175 93.03 19.92 25.33
#3184 81.53 23.09 20.75
#3210 71.80 16.62 25.73
#3209 90.22 22.43 33.19
#3203 72.02 18.82 28.16
Median across all tested jobs 75.63 19.55 25.58
Jobs requiring a package retry 12/12 (100%) 3/12 (25%) 1/12 (8.3%)

This sample contains 36 executed test jobs. Some PRs had two Node versions rather than three. Two other recent PRs never reached testing and were excluded from the retry denominators. These are historical observations, not a controlled benchmark.

Both initial execution and retries are expensive:

  • macOS initial passes took 38–92 minutes, with a 61.85-minute median, before retries. Every sampled macOS job retried, so the sample has no retry-free macOS control.
  • Memory-service retries reran 61–67 suites for only 1–6 failed files, costing another 7–30 minutes. In one job, dispatcher reran 146 suites after one file failed, taking 11.5 minutes.
  • Roughly 73% of macOS failed-case occurrences were timeouts or bounded waits. All recovered on the observed serial package retries. The logs suggest timing sensitivity but do not establish the underlying resource or runtime cause.
  • The slowdown extends beyond memory: in the separately investigated run 39985375882, dispatcher took 50–56 minutes and default-agent-provider took 34–37 minutes on the slow macOS jobs.

Removing a few scaling tests would not address these delays. This PR keeps a smaller macOS compatibility suite blocking changes, moves full macOS coverage to nightly runs, and reduces unnecessary retry work.

Changes

  1. Split blocking and nightly macOS coverage.

    • PR, merge-queue and push jobs run an explicit selection of 13 package suites on macOS, across all three supported Node versions.
    • The selection covers file links, native SQLite, locking, memory publication/persistence/privacy, small Git history, session lifecycle, and representative cache merge/non-merge round trips.
    • All root script tests remain blocking, including aliased-directory healing and subprocess checks.
    • Full macOS correctness coverage runs nightly at 08:17 UTC on the default branch, across all supported Node versions. Manual dispatch runs full coverage on all three operating systems.
    • Full Ubuntu/Windows blocking coverage is unchanged. The default local test profile also remains full.
  2. Retry failed files where the runner supports it.

    • Recognized single-invocation Jest scripts retry the accumulated failed files serially, with caching disabled, up to twice.
    • Chained commands, lifecycle hooks and unsupported runners explicitly fall back to the complete package command so retries do not bypass setup or additional test phases.
    • Missing failure artifacts and invalid file selections fail closed rather than clearing failures.
  3. Fix test-phase accounting.

    • Previously, a package failure short-circuited the root script-test command. A successful package retry could then report green without ever running those script tests.
    • Workspace tests/retries and root script tests now have independent outcomes. Root script tests run even after unrecovered package failures, and both phases must pass.
    • GitHub summaries report each phase separately; workflows retain test logs for 14 days.
  4. Apply consistent Jest settings.

    • Browser, browser-extension and CLI configurations now honor the shared CI-only one-worker limit and retry cache setting.
    • CLI uses the shared failure reporter when reporting is enabled.
  5. Fix macOS aliased-path handling in generated-file healing.

    • Resolve generated-file and scratch-manifest destinations from canonical roots. This avoids false containment failures when macOS temporary paths resolve from /var to /private/var.
    • Add an aliased-directory regression while preserving containment and regular-file checks.
  6. Separate memory correctness from scaling coverage.

    • Keep a ten-commit history-equivalence case in normal CI.
    • Move the 100/1,000-commit variants to a dedicated regression command and a weekly/manual workflow on Ubuntu, Windows and macOS.
    • Keep bounded offline correctness scenarios in CI; the external-data/model-backed rehearsal was already excluded.

Coverage tradeoff

The blocking macOS selection is intentionally not the full correctness suite. Full Ubuntu/Windows coverage still blocks PRs, but macOS-only regressions outside the selection may first appear nightly. Maintainers should triage nightly failures and add missing platform-sensitive regressions to the blocking selection. Contract tests check the explicit selection and event-specific workflow configuration.

This PR does not claim a measured macOS speedup yet. It also does not fix the separately identified MCP shutdown test that waits for the client's 60-second timeout.

Validation

  • Full workspace build passed.
  • Compatibility profile: 13 suites / 276 tests passed locally.
  • Combined profile, workflow, Node-version, Jest-configuration and retry checks: 78 tests passed.
  • After the retry-orchestration refactor, all 56 focused retry tests passed. The committed complexity, lint and test-debt gates passed without threshold changes.
  • Generated-file-healing tests: 32 passed, with five existing Windows skips.
  • Local validation used Windows with Node 24.13.0, below the supported minimum. The broader root script suite had one installer-test failure because it requires a supported Node runtime; this PR does not change or suppress that test.
  • Actual macOS behavior and runtime still require CI validation.

Keep representative macOS correctness checks blocking and run full macOS coverage nightly. Preserve independent script-test accounting, retry failed Jest files safely, canonicalize generated-file paths, and move history scaling to periodic regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extract individual package retries without changing failure classification or test phase accounting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hillary-mutisya
Hillary Mutisya (hillary-mutisya) marked this pull request as ready for review October 23, 2026 21:32
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 23, 2026
@hillary-mutisya
Hillary Mutisya (hillary-mutisya) merged commit 01533d9 into main Oct 24, 2026
30 checks passed
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.

2 participants