Skip to content

ci: Speed up macOS job

Patrick Steinhardt requested to merge pks-ci-macos-speedup into master

Our macOS job is extremely slow, taking around 55 to 65 minutes to complete. This MR aims to change that by doing a few iterative changes:

  • It makes generation of coverage information optional and disables it for macOS. As macOS is an optional job anyway you typically don't see the coverage information in the merge request widgets, so it's not quite that important. This buys us a minute or two generating the coverage report.
  • It converts the macOS job to write test data into a RAM disk. As Runners use EBS storage volumes it is known that writes are slow, and given that Gitaly tests are quite I/O heavy this makes itself felt. This reduces test execution time from ~2500 seconds to ~600 seconds.
  • It disables Gatekeeper, which is a mechanism to check for known-malicious executables every time macOS executes a binary. Given that we execute lots of binaries during our tests this mechanism also has some impact. This brings test execution down from ~600 seconds to ~480 seconds.

The end result is thus a CI job that runs in about 15 minutes instead of 55 to 65 minutes, which is a significant improvement. Unfortunately though, this improvement is currently completely pointless due to macOS M1 runners hang after `script` step in Gi... (gitlab-org/ci-cd/shared-runners/infrastructure#92 - closed), which causes the job to deadlock after the script stage. But regardless of that I think we should be landing these changes already as the issue needs to be fixed outside of the Gitaly team.

Closes #5341 (closed).

Edited by Patrick Steinhardt

Merge request reports