Skip to content

ci: run darwin tests on Buildkite-hosted agents while the mac fleet is offline - #37354

Merged
alii merged 3 commits into
mainfrom
ci/darwin-hosted-stopgap
Aug 11, 2026
Merged

alii merged 3 commits into
mainfrom
ci/darwin-hosted-stopgap

Conversation

@alii

@alii alii commented Aug 10, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Stopgap while the bare-metal macOS test fleet (test-darwin queue) is offline being reimaged.

  • Darwin test steps now target a test-darwin-hosted queue backed by Buildkite-hosted M4 agents, instead of selecting fleet agents by os/arch/release-tier tags.
  • Only the aarch64 latest (macOS 26) lane runs there. Hosted agents are Apple Silicon only and the queue is pinned to a single image, so the aarch64 previous and the x64 lanes are dropped until the fleet returns.
  • Darwin tests run on main, or on a PR when the commit subject contains [macos tests]. Other PR pushes skip them, to bound hosted-agent spend. Darwin build lanes are unaffected (they cross-compile on Linux), so PRs still prove darwin compiles.

Needs the test-darwin-hosted queue to exist in the CI cluster before merge (Buildkite hosted, MACOS_ARM64_M4_6X28, macOS 26 image). Until it does, darwin test jobs on main will wait for an agent, which is no worse than today.

Revert this PR when the fleet is back.

How did you verify your code works?

node .buildkite/ci.mjs --dry-run with Buildkite env for three cases:

  • main: one darwin-aarch64-26-test-bun step, agents: { queue: test-darwin-hosted }
  • PR, plain subject: darwin build steps present, zero darwin test steps
  • PR with [macos tests] in the subject: same single darwin test step as main

…s offline

The bare-metal macOS fleet behind the `test-darwin` queue is offline being
reimaged. Until it returns:

- darwin test steps target a `test-darwin-hosted` queue (Buildkite-hosted M4
  agents) instead of the fleet's tag-selected agents
- only the aarch64 `latest` (macOS 26) lane runs there: hosted agents are
  Apple Silicon only and the queue is pinned to one image, so the aarch64
  `previous` and x64 lanes are dropped for now
- darwin tests run on main, or on a PR when the commit subject contains
  `[macos tests]`; other PR pushes skip them to bound hosted-agent spend.
  Darwin build lanes are unaffected (they cross-compile on Linux)

Revert this commit when the fleet is back.

No-Verification-Needed: CI pipeline config only; checked with ci.mjs --dry-run
@robobun

robobun commented Aug 10, 2026 •

Copy link
Copy Markdown
Collaborator
Updated 5:43 PM PT - Aug 10th, 2026

@alii, your commit a16b111 is building: #91728

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 42f5e243-513d-458f-ba62-2a663e970b9d

📥 Commits

Reviewing files that changed from the base of the PR and between 5b825a7 and a16b111.

📒 Files selected for processing (1)
  • .buildkite/ci.mjs

Walkthrough

Darwin CI scheduling now uses the temporary test-darwin-hosted queue. Darwin tests run on main, manual builds, or explicitly tagged commits. Hosted execution retains only the aarch64 latest platform.

Changes

Hosted Darwin test scheduling

Layer / File(s) Summary
Hosted Darwin configuration
.buildkite/ci.mjs
Darwin agents use the test-darwin-hosted queue. Hosted execution permits only the aarch64 latest Darwin lane.
Darwin platform selection
.buildkite/ci.mjs
Darwin tests run on main, manual builds, or commits with the [macos tests] or [darwin tests] tag. Unsupported Darwin platforms are excluded. The existing main-branch ASAN filtering remains.

Suggested reviewers: jarred-sumner, dylan-conway, robobun

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description includes both required sections and clearly explains the CI changes, limitations, prerequisites, and verification cases.
Title check ✅ Passed The title clearly and concisely summarizes the main change: moving Darwin tests to Buildkite-hosted agents while the macOS fleet is offline.
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.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.buildkite/ci.mjs:
- Around line 435-437: Verify that the CI cluster contains the
test-darwin-hosted queue and that it is populated with Apple Silicon macOS 26
agents before merging the darwinHostedQueue selector. If the queue is absent or
contains non-Apple-Silicon macOS agents, update the queue configuration or
selector so the Darwin step schedules correctly and satisfies the
EXPECTED_PLATFORM_* checks.
- Around line 401-408: Update the temporary cleanup note near getTestAgent() to
explicitly instruct restoring the previous platform-tagged test-darwin selector
there, alongside deleting darwinHostedQueue, darwinTestsEnabled, and the
getPipeline() filter.
- Around line 414-416: Update darwinTestsEnabled to extract only the first line
of getCommitMessage() before applying the macos/darwin opt-in regular
expression, while preserving the isMainBranch behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 65b5f32f-5770-4cda-882a-129b6993c7dd

📥 Commits

Reviewing files that changed from the base of the PR and between 827475e and 5b825a7.

📒 Files selected for processing (1)
  • .buildkite/ci.mjs

Comment thread .buildkite/ci.mjs Outdated
Comment thread .buildkite/ci.mjs
Comment thread .buildkite/ci.mjs

@claude claude Bot 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.

LGTM — temporary CI-only reroute of darwin test lanes to a hosted queue, well-commented with a clear revert path.

What was reviewed:

  • Filter logic in getPipeline(): both new predicates pass non-darwin platforms through unchanged; on main only darwin-aarch64-26 survives, matching the hosted queue's arm64/macOS-26 constraint.
  • getTestAgent change is safe for the other darwin caller (getTraceOrderStep via traceOrderTargets) — that lane is also aarch64/latest and soft-fails.
  • EXPECTED_PLATFORM_RELEASE for the surviving lane is "26", which matches the hosted image; canary release gating on main still sees the remaining darwin test key.
Extended reasoning...

Overview

This PR touches only .buildkite/ci.mjs, the pipeline generator. It adds a hosted-queue constant, two small predicates (darwinTestsEnabled, isRunnableDarwinTestPlatform), swaps the darwin branch of getTestAgent to return { queue: 'test-darwin-hosted' }, and chains two .filter() calls onto relevantTestPlatforms so darwin test lanes are (a) dropped on PRs unless the commit subject opts in, and (b) narrowed to the single aarch64/latest lane the hosted agents can run.

Security risks

None. This is CI orchestration YAML generation — no product code, no auth, no user input handling. The new regex runs against the commit subject (already used the same way for [build images] etc.).

Level of scrutiny

Low. It is a self-described temporary infra stopgap, confined to one CI script, with detailed comments explaining the constraint and explicit deletion instructions for the revert. Worst-case failure mode is a mis-scheduled Buildkite step, which is immediately visible and does not affect the shipped product. The author verified with --dry-run across the three relevant scenarios.

Other factors

I traced the knock-on effects: the traceOrderTargets darwin entry also flows through getTestAgent and will land on the hosted queue — that's fine since it targets aarch64/latest and is soft_fail: true. The release step's testStepKeys gate on main now includes one darwin key instead of three, which is the intended reduction. getTestBunStep sets EXPECTED_PLATFORM_RELEASE: '26' for the surviving lane, matching the hosted image. Merge-queue builds fall under the PR path (no darwin tests unless opted in), consistent with the cost-bounding intent. Nothing here touches build lanes, so darwin still proves it compiles on every PR.

@claude claude Bot 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.

Beyond the inline nit, I also checked: the darwin trace-order step (traceOrderTargets) — its host is aarch64/latest, so it lands on the hosted queue correctly on main; EXPECTED_PLATFORM_RELEASE: "26" on the surviving lane matches the hosted queue's pinned macOS 26 image; and getCommitMessage() matching the full body — on Buildkite it reads BUILDKITE_MESSAGE (subject-only), same as every other [tag] opt-in in this file, so that's consistent.

Extended reasoning...

This is a small, clearly-temporary CI-only change with one minor nit filed inline. I checked a few adjacent concerns the diff touches indirectly (trace-order routing, EXPECTED_PLATFORM_* env, commit-message matching semantics) and none are affected. Leaving the approval decision to a human because the change reduces what gates canary releases on main and depends on an out-of-band Buildkite queue being provisioned — both things a maintainer should acknowledge rather than a bot.

Comment thread .buildkite/ci.mjs
…ert note

- darwinTestsEnabled() also returns true for isBuildManual(), so picking a
  darwin lane in the New Build options form is not silently dropped for
  lack of a [macos tests] tag in the message
- the temporary-block comment now says to revert the commit rather than
  delete pieces by hand, since getTestAgent()'s old selector must come
  back with it

No-Verification-Needed: CI pipeline config only; checked with ci.mjs --dry-run
@alii
alii merged commit 5effdb2 into main Aug 11, 2026
23 of 33 checks passed
@alii
alii deleted the ci/darwin-hosted-stopgap branch August 11, 2026 00:49

@claude claude Bot 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.

LGTM — the manual-build opt-in and revert-note concerns from the earlier round are addressed in a16b111.

Checked that the surviving darwin aarch64 26 / latest lane is also the one traceOrderTargets uses, so the darwin trace-order step on main still resolves to a runnable agent. The [macos tests] regex over getCommitMessage() matches how every other commit-message option in this file already works (BUILDKITE_MESSAGE is subject-only in CI), so not splitting on newline is consistent. Canary release on main now gates on one darwin lane instead of three, which is the point — the other two have no agents to run on.

Extended reasoning...

Overview

Temporary CI pipeline change in .buildkite/ci.mjs only: routes darwin test steps to a Buildkite-hosted test-darwin-hosted queue while the bare-metal mac fleet is offline, restricts darwin testing to the single aarch64/macOS-26 lane the hosted queue can serve, and gates darwin tests on main / manual UI builds / a [macos tests] commit-subject opt-in to bound per-minute hosted spend. No runtime, bindings, or test code touched.

Security risks

None. This is pipeline-generation JS that emits Buildkite YAML. No new secrets, no external input parsing beyond the existing getCommitMessage() regex pattern already used for every other [tag] option in the file.

Level of scrutiny

Low-medium. It's infrastructure config, explicitly temporary, with a one-commit revert plan. The two things that would normally warrant a human — the external test-darwin-hosted queue prerequisite and the change to what gates canary — are both called out in the PR description, and the fallback if the queue is missing (step waits for an agent) is stated as no worse than the current state (fleet offline, steps already wait forever).

Other factors

  • My earlier review flagged that a manual UI build selecting darwin in the block-step form would be silently dropped; the author added isBuildManual() to darwinTestsEnabled() and documented it in the block comment. Addressed.
  • CodeRabbit's rollback-note concern is addressed: the comment now says "revert the commit that added this block" and names both getTestAgent() and the getPipeline() filter.
  • CodeRabbit's "read only the subject" suggestion was correctly not taken — getCommitMessage() reads BUILDKITE_MESSAGE (subject-only) in CI, and every other parseOption regex in getPipelineOptions() matches against the same value without splitting.
  • Traced traceOrderTargets: the darwin entry targets {aarch64, release: 26, tier: latest}, which is exactly the lane isRunnableDarwinTestPlatform keeps, so the darwin trace-order step on main still gets a valid {queue: test-darwin-hosted} agent.
  • No CODEOWNERS entry for .buildkite/.
  • Author verified the three cases via --dry-run.

alii added a commit that referenced this pull request Aug 11, 2026
…7364)

### What does this PR do?

#37344 commented out the three darwin `testPlatforms` entries and the
darwin `trace-order` target while the mac fleet was offline. #37354
(merged after it, but branched before it) routes darwin tests to
Buildkite-hosted agents instead; with the entries gone there is nothing
left to route, so **main currently runs no darwin tests at all** (see
build 91730: 0 darwin test steps).

This puts the entries back. #37354's filter still drops the two lanes
hosted agents can't run (aarch64 `previous`, x64) and gates the rest to
`main` / `[macos tests]`, so the effective result is one aarch64 macOS
26 lane on `test-darwin-hosted`, which build 91720 already showed
passing in ~13 min. Reverting #37354 when the fleet is back brings all
three lanes back with no further edit here.

### How did you verify your code works?

`node .buildkite/ci.mjs --dry-run` on top of current main:
- `main`: `darwin-aarch64-26-test-bun` + `darwin-aarch64-trace-order`,
both `queue: test-darwin-hosted`
- PR, plain subject: no darwin test steps
- PR with `[macos tests]`: the single darwin test step
alii added a commit that referenced this pull request Aug 11, 2026
### What does this PR do?

Darwin test steps were pinned to `parallelism: 2` because the bare-metal
fleet only had a couple of boxes per lane. On the Buildkite-hosted queue
from #37354 every shard gets its own M4 agent, so widen darwin to 10
shards.

Expected effect per main build: the ~26 min darwin suite (2 × 13 min on
hosted today, build 91720) becomes ~26/10 + ~2 min per-shard setup ≈ 4-5
min wall clock, for roughly +30% billed minutes (each shard repeats
checkout / artifact download / `bun install`). Not going wider than 10
because beyond that the fixed setup dominates.

Revisit together with the #37354 revert once the fleet is back (the
fleet can still absorb 10 queued shards per lane, it just serializes
them).

### How did you verify your code works?

`node --check`; the value only feeds the step's `parallelism` field, and
`runner.node.mjs` already shards by `BUILDKITE_PARALLEL_JOB`/`_COUNT`
(linux runs 20-wide the same way).
Jarred-Sumner pushed a commit that referenced this pull request Aug 12, 2026
…7633)

The macOS test agents are back on `test-darwin`, so this undoes the
hosted-queue detour from #37354 / #37369:

- darwin aarch64 tests (`latest` and `previous` lanes) run on every
build again, not just main / `[macos tests]`
- tag-based agent selector (`queue=test-darwin, os, arch, release-tier`)
restored, hosted queue and its helpers removed
- sharding back to 2 per lane
- darwin symbol-order trace target restored

The x64 test lane stays commented out until the Intel agents are back;
that is the only difference from the pre-outage file.

`--dry-run` for a PR build:
```
darwin-aarch64-26-test-bun {queue: test-darwin, os: darwin, arch: aarch64, release-tier: latest} parallelism=2
darwin-aarch64-14-test-bun {queue: test-darwin, os: darwin, arch: aarch64, release-tier: previous} parallelism=2
```
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