Skip to content

ci: migrate Instrumentation tests to ubuntu-latest with KVM + AVD cache#1051

Open
joaodordio wants to merge 1 commit intomasterfrom
ci/migrate-instrumentation-tests-to-ubuntu
Open

ci: migrate Instrumentation tests to ubuntu-latest with KVM + AVD cache#1051
joaodordio wants to merge 1 commit intomasterfrom
ci/migrate-instrumentation-tests-to-ubuntu

Conversation

@joaodordio
Copy link
Copy Markdown
Member

Why

The required Instrumentation tests check has been flaking on macos-15-intel runners — see #1049, where the emulator never reached port 5554 and the job died in 32s during AVD/system-image setup. Master's Build and Test workflow shows the same job intermittently red across recent merges. GitHub is also winding down the Intel mac fleet.

What

  • Move the job to ubuntu-latest with nested-virtualization KVM enabled. This is the path officially recommended by reactivecircus/android-emulator-runner.
  • Bump the action: v2.30.1v2.34.0 (still pinned to commit SHA).
  • Switch to api-level: 29 + arch: x86_64 (better supported than the legacy API 28 x86 image, especially with newer SDK manager versions).
  • Add actions/cache for the AVD plus a warm-up step that creates the snapshot once and caches it. Subsequent runs reuse it and skip cold AVD creation.
  • Make emulator options explicit (-no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim) so behavior is reproducible.

Expected wins

  • ~3× faster than macOS (KVM > swiftshader on real hardware).
  • Far fewer "emulator never booted" failures.
  • AVD cache keeps warm runs ≲2 min.

Risk / regressions to watch

  • API 28 → 29 behavior diffs. Anything in iterableapi:connectedCheck that asserts on Build.VERSION.SDK_INT == 28 or relies on permission semantics that changed in P→Q (e.g., scoped storage onset, foreground service tweaks) will need a tweak. Worth a grep before merge.
  • Linux file-system case sensitivity. Any resource/asset/path lookup that worked by accident on case-insensitive macOS may surface here. Usually a good thing — bugs we should fix anyway.
  • x86 → x86_64 image. No expected functional regression; x86_64 is a strict superset for the AOSP system images. Just heavier disk usage on the runner.
  • Cache key. avd-29-x86_64-v1 — bump the suffix any time we change api-level, arch, target, or system-image version, otherwise stale snapshots.
  • Action defaults changed in v2.34.0. Most relevant: arbitrary api-level strings now allowed, system-image-api-level knob added, automotive/desktop targets supported. Nothing that should affect a stock default x86_64 setup, but flagged for completeness.
  • First run is slow. No cache hit means full AVD creation (~5–7 min). Acceptable one-time cost; subsequent PRs hit the warm cache.
  • gradle/actions/setup-gradle (used implicitly by the action) caching collisions. Should be a non-issue since we don't use it explicitly here, but keep an eye out if future jobs add it.
  • macOS-only test assumptions. None known in iterableapi:connectedCheck, but if any test shells out or reads /System/Library/...-style paths it would break. Unit tests on ubuntu-latest already pass green, so iterableapi itself is portable.

Test plan

  • CI runs this PR's Instrumentation tests job on Ubuntu and goes green.
  • Re-run a couple of times to validate cache-hit and cache-miss paths.
  • Verify total job runtime is well under the macOS baseline.
  • Cross-check SDK-412 UUA Naming inconsistencies #1049 (and any other flaky PRs) once this is merged to confirm flakiness is gone on master.

Made with Cursor

Move the required `Instrumentation tests` job off the flaky `macos-15-intel`
runner. KVM-accelerated `ubuntu-latest` is the official `android-emulator-runner`
recommendation, runs ~3x faster, and is dramatically more stable than the
deprecating Intel mac fleet that has been failing this required check on
master.

- Bump `reactivecircus/android-emulator-runner` v2.30.1 -> v2.34.0
- Switch to API 29 x86_64 (better-supported image than legacy API 28 x86)
- Add AVD cache + warm-up step to cut cold-start time
- Pin all action SHAs
@joaodordio joaodordio marked this pull request as ready for review May 6, 2026 14:43
@joaodordio joaodordio self-assigned this May 6, 2026
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