From 05b43f45104eed2f467cd08cc8366e9b7496e360 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Fri, 3 Jul 2026 16:45:24 -0500 Subject: [PATCH] build(gmd): cap managed-device emulators to 1 concurrent (serial) to avoid local VT-x contention The e2e Gradle Managed Device group spans api29-36 and org.gradle.parallel=true is set, so a local e2eGroupDebugAndroidTest (or preflight's api36DebugAndroidTest) can launch several emulators at once. They contend for the same VT-x/HAXM virtualization slot on a single machine and hang at 0% CPU with "another emulator instance is running". Set android.experimental.testOptions.managedDevices.maxConcurrentDevices=1 in gradle.properties to force GMD emulator runs serial locally. CI is unaffected: its e2e matrix boots one emulator per API level on separate GitHub Actions runners via reactivecircus/android-emulator-runner and connectedDebugAndroidTest, not these Gradle Managed Device tasks, so the cap doesn't apply there regardless. Co-Authored-By: Claude Opus 4.8 --- gradle.properties | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gradle.properties b/gradle.properties index 158680d..5fda3b1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,3 +9,14 @@ android.useAndroidX=true # Kotlin (built-in Kotlin is enabled by default in AGP 9; the Kotlin version is set # via the buildscript classpath in the root build.gradle.kts). kotlin.code.style=official + +# Gradle Managed Devices (app/build.gradle.kts `testOptions.managedDevices`): cap the number +# of emulators Gradle boots at once to 1. The `e2e` device group spans api29-36 and +# org.gradle.parallel=true is on, so without this cap a local `e2eGroupDebugAndroidTest` (or +# the /preflight skill) can launch several emulators concurrently; they contend for the same +# hardware VT-x/HAXM virtualization slot and hang at 0% CPU ("another emulator instance is +# running"). This forces GMD emulator runs to be serial on a single machine. Does not affect +# CI: the `e2e` matrix in .github/workflows/ci.yml runs each API level's emulator on its own +# GitHub Actions runner via reactivecircus/android-emulator-runner + connectedDebugAndroidTest, +# not via these Gradle Managed Device tasks, so this cap has no effect there either way. +android.experimental.testOptions.managedDevices.maxConcurrentDevices=1