Skip to content

CI: connected-tests red on ubuntu-24.04 - emulator silently runs with -accel off (KVM permission drift) #655

Description

@satwareAG-ironMike

Symptom

connected-tests has been failing on master since ~Sep 1 without any related change (last green: run 33282696905 on Aug 30; first failure: run 31692873970 Aug 13, then recurring). Errors in the failed runs:

  • Unable to connect to adb daemon on port: 5037 (boot wait loop, exit code 1 spam)
  • Mid-suite device death: adb exit code 224, cmd: Failure calling service settings: Broken pipe (32)
  • The Save logcat output step logs adb: command not found on some runs

Root cause (found in the emulator's own log)

ProbeKVM: This user doesn't have permissions to use KVM (/dev/kvm).
[command] .../emulator -port 5554 -avd test ... -accel off &

A recent GitHub runner image update appears to have dropped the runner user's access to /dev/kvm. ReactiveCircus/android-emulator-runner then silently falls back to -accel off, i.e. full software x86 emulation: boots take 15+ minutes or never complete, and the device dies mid-suite.

Fix

Add the KVM udev snippet from the action's README ("Running hardware accelerated emulators on Linux runners") before the emulator step:

- name: Enable KVM group perms
  run: |
    echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
    sudo udevadm control --reload-rules
    sudo udevadm trigger --name-match=kvm

Optionally also android-actions/setup-android@v3 before the adb logcat step, so adb is guaranteed on PATH (fixes the command-not-found there too).

Verification

We maintained a fork of this repo and hit identical failures independently. After adding exactly this step, connected-tests went green on consecutive runs in ~7m40s each (was: 19-minute failures). Full diagnosis trail: satwareAG-ironMike/CleanArchitectureForAndroid PR #3 (merged).

Happy to send this as a PR if useful - just say the word.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions