Repository navigation
Run macOS tests with Xcode's git and Spotlight off, and record where macOS test time goes - #928
Merged
Merged
Conversation
Profiling the macOS shards (#894) found the slowest tests are git processes, each costing about 13 ms under Homebrew's git, and Spotlight indexing the tests' repositories. Xcode's git alone took 38% off the shards' summed test time. docs/ci-performance.md records the method, the runs and the breakdown. Two security_run tests that run thirdshift with only git on PATH now also link the transport programs Xcode's git needs beside it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fifth profile pass traced the 19 slow tests the first passes left out, including three of the 16 over 60 seconds, so the breakdown table now covers all 26 with their Linux git counts beside the macOS ones. The CI comment now says why the git-* programs are linked, and link_git links git before the optional transport programs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The macOS shards' remaining time is git processes. Most come from Worktree ownership inspection and the launch-side recheck (#858). Homebrew's git also costs about 13 ms per process on the runner, where Xcode's costs 9 ms. This PR leaves the checks alone and makes each git process cheaper in macOS CI:
docs/ci-performance.mdadds "After Inspect Worktree ownership with fewer git processes to shorten macOS CI #857: the macOS breakdown": five diagnostic passes, with method, runs, and a per-test breakdown by cause for the 26 slowest tests.tests/security_run.rs: two tests run thirdshift with onlybinonPATH. A sharedlink_gitnow linksgit-upload-pack/git-receive-packbesidegitwhen present. Xcode's git looks for them only beside itself. Their assertions are unchanged.Where the time goes (26 tests alone on
macos-26, dtrace; caller split from Linux strace of the same tests):Evidence
macOS test-step seconds (the
cargo nextest runstep, build included, as in #894's table). Run-to-run noise onmainis ±15% (#857):mainafter #857, 39424072554mainafter #857, 39424576921mainafter #857, 39430050727mainrun after mergeBoth of this PR's runs, on the same commit, are well outside the noise: the first is 38–43% below the three post-#857
mainruns and the final one 56–59% below. Build excluded, their nextest time was 2,198 s and 1,590 s. The gap between the two is runner variance, larger than #857 measured.Opening the PR with
test:macosalready applied started anopenedand alabeledrun. The first was cancelled, leaving cancelled checks on the head, whichdocs/ci-performance.mdwarns about. Re-running it replaced them and gave the second measurement. In that re-run, Linuxtestfailed once intests/console_install.rs:269,unit_preserves_literal_paths_with_shell_and_systemd_metacharacters:Text file busy(ETXTBSY) executing a freshly copied binary. That file is untouched here, andtestpassed in the first run and on re-running the job. It is a pre-existing race, left for the Day shift.Diagnostic passes (nextest time, build excluded, from
docs/ci-performance.md): fivemainruns summed 3,327–3,595 s. With Spotlight off alone they summed 3,209 s, inside the noise. With Xcode's git alone, 2,132 s.Before: in pass 4, with Xcode's git,
security_run an_unavailable_github_cli_has_a_safe_pre_audit_dependency_causeandmissing_node_fails_before_any_session_and_names_the_prerequisitefailed:git-upload-pack: command not found.After: both pass on Linux. On macOS they pass in this PR's full-suite run (39559241797: all four shards passed).
Local x86_64 Linux:
cargo nextest run2,168 passed;cargo test2,171 passed;cargo clippy --all-targets -- -D warningsandcargo fmt --checkclean.Merge Danger
Door: two-way. Revert the two CI steps to get Homebrew's git and Spotlight back.
Blast Radius: CI-only.
macOS CI now tests against Xcode's git 2.50.1 instead of Homebrew's 2.56.0. A bug that shows only with Homebrew's newer git would not show on macOS. Linux CI keeps Ubuntu's git. No
src/change, and Worktree ownership checks are unchanged.Unaddressed findings
Standards
test-macos-gateandtest-macos-shard. Declined.ci.ymlalready repeats each job's toolchain and cache steps per job, for example "Install the Rust version…" intest,test-macos-gateandtest-macos-shard. The gate's comment points to the shards' explanation.which gitlookup duplicated withtests/pickup_run.rs::install_git_wrapper. Left as is. That duplication predates this PR, and the reviewer marked it optional.Spec
mainand nightly shards would test those tests on a git the full suite no longer uses.macos-planis untouched, so no event's macOS work changes (Run the full macOS suite on main and nightly, with a one-job macOS gate on PRs into main #893 stays out of scope).Review coverage: both reviewers read all three changed files. No generated output was excluded.
The diagnostic workflow lives on the
issue-894-profilebranch, which the doc's run links point to. Delete it whenever its logs are no longer needed.Closes #894
🤖 Generated with Claude Code
Built with claude · claude-opus-5-5 · medium
Security review outcome
No unaddressed introduced findings.