Skip to content

ci(android): store AVD on /mnt for emulator e2e workflows#18387

Open
mikehardy wants to merge 1 commit into
firebase:mainfrom
mikehardy:ci/android-avd-home-mnt
Open

ci(android): store AVD on /mnt for emulator e2e workflows#18387
mikehardy wants to merge 1 commit into
firebase:mainfrom
mikehardy:ci/android-avd-home-mnt

Conversation

@mikehardy

@mikehardy mikehardy commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Problem

This was an e2e flake failure mode that surfaced on the sister repository react-native-firebase, I'm porting it here in an attempt to solve an e2e failure that will hit here, before it does 🫡

On GitHub-hosted ubuntu-latest runners, AVD userdata is created on the root filesystem (/). After bootstrap, Gradle, and SDK install, / can drop to ~7 GB free while a fresh API 36 AVD needs ~7.4 GB — the emulator fails immediately:

FATAL | Not enough space to create userdata partition.
Available: 7090.64 MB, need 7372.80 MB

Runners also mount a secondary volume at /mnt (~66–74 GB free) that we were not using for AVD storage. FlutterFire currently runs API 34 (smaller userdata) and frees disk before the emulator, so this has not surfaced yet, but the same failure mode applies on cache misses or future API bumps.

How android-emulator-runner uses ANDROID_AVD_HOME

sdk-installer.ts sets ANDROID_AVD_HOME (via core.exportVariable) to $HOME/.android/avd. emulator-manager.ts creates the AVD under ${process.env.ANDROID_AVD_HOME}/${avdName}.avd. The action README’s AVD cache example also documents caching ~/.android/avd/*.

Fix

In all three android-emulator-runner workflows (android.yaml, e2e_tests_pipeline.yaml, e2e_tests_fdc.yaml):

  1. Prepare AVD home on /mnt — create /mnt/avd and chown it before cache restore / avdmanager create avd.
  2. AVD cache paths — restore/save /mnt/avd/* instead of ~/.android/avd/*.
  3. Link AVD home to /mnt — symlink $HOME/.android/avd/mnt/avd before the action runs (the action always targets $HOME/.android/avd; a pre-emulator-launch-script symlink is too late).
  4. ANDROID_AVD_HOME: /mnt/avd on the emulator-runner step.

Test plan

  • Android e2e workflow (android.yaml) green on PR
  • Pipeline Android e2e (e2e_tests_pipeline.yaml) green on PR
  • FDC Android e2e (e2e_tests_fdc.yaml) green on PR

@mikehardy mikehardy requested a review from Lyokone June 20, 2026 00:27
@mikehardy mikehardy requested a review from Lyokone as a code owner June 20, 2026 00:27
@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

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