Repository navigation
💥 ☂️ Solution to fleet-wide Android emulator crashes on CI #153445
Description
Forked from #152769 as it's unrelated to my specific test.
As of 2024-08-14, we have systemic fleet-wide Android emulator crashes that appear unrelated with any specific test:
- Linux_android_emu external_textures_integration_test is 35.79% flaky #153431
- Linux_android_emu android views is 40.00% flaky #153424
- Flutter native driver Android test has at least 1 flake related to VM service (?) #152769
- Linux_android android_semantics_integration_test is 18.00% flaky #98417
In nearly every case, the following occurs (note that every test uses a slightly different setup, the logs are not uniform):
- The emulator successfully starts (as part of a CI task job)
- The test, typically using
flutter drive ...installs the test APK, and starts executing - An ambient print message appears in the console:
getIsolate: (-32000) Service connection disposed - The test (driver script) ends (usually you'll see
adb: device offlinein the logs by this point) with a failure
Confusingly, these tests work run fine roughly 95% - 99% of the time.
My plan this week is roughly the following:
- Try LED builds of the Android emulator try-jobs, trying to extract crash logs, twiddle scripts
- See what the memory usage of the emulator is locally (we have a max of 2gb right now)
- Meet with the maintainer of the Chromium Android emulator tools (we use) on GVC
/cc @reidbaker @zanderso @johnmccutchan @christopherfujino @chunhtai
TODOs
-
Consider removing
--writable-system:✅ https://flutter-review.googlesource.com/c/recipes/+/59180/1
W 15:30:04.302 0.034s Main Emulator will be slow to start, as "writable_system=True" but system snapshot not found.
-
Try meeting with the Chromium Android emulator team on any obvious next steps.
✅ Upgrading to the latest
avd_cipd_version:
Rollavd_cipd_verisonto latest to use thecrashreporttool. #153520 -
Try getting a copy of the
emu-crash.dblog entries, if any.❌ Did not result in anything.
During emulator startup, the console reads:
INFO | Storing crashdata in: /tmp/android-unknown/emu-crash-34.2.14.db, detection is enabled for process: 124450
I wrote a small script to try and scrape this directory when a test crashes, but it resulted in nothing:
Could not read file: /tmp/android-unknown/emu-crash-34.2.14.db/settings.dat
It's possible that nothing is being logged, the logs are actually elsewhere, but seems like a dead end for now.
-
Try running the same tests on Github Actions VM and see if I observe similar flakes:
✅ Ran overnight on a 15m cron, API v35 seems too unstable to use as non-bringup task:
-
[ ] Try running a demo Android app (or even just the emulator itself) without any Flutter -
[ ] Try SSHing into a bot and running steps manually to try and detect the crash
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zanderso commentedon Aug 14, 2024
Also FYI @camsim99
matanlurey commentedon Aug 14, 2024
One interesting note so far is this log message at the top of every Android emulator run:
reidbaker commentedon Aug 14, 2024
Related internal bugs https://b.corp.google.com/issues/326109113 https://b.corp.google.com/issues/344730009
reidbaker commentedon Aug 14, 2024
Do we know the size of the vms that are hosting the emulators?
According to android they can crash if there is less than 5gb of disk space. https://developer.android.com/studio/run/emulator-troubleshooting#disk-space
zanderso commentedon Aug 14, 2024
These are running on
n1-standard-8instances. https://cloud.google.com/compute/docs/general-purpose-machines#n1_machine_types. I'll try to find the config file for our pool and share the link internally to double check.matanlurey commentedon Aug 14, 2024
Didn't solve the flakiness issue, but got rid of an error message and sped up startup time a bit:
https://flutter-review.googlesource.com/c/recipes/+/59180/1
reidbaker commentedon Aug 15, 2024
Based on what I read about those instances the space is measured in Terabytes so we are probably ok on disk space.
johnmccutchan commentedon Aug 15, 2024
johnmccutchan commentedon Aug 15, 2024
Log of AVD configuration:
zanderso commentedon Aug 15, 2024
Found the config. Disks are 300 GB on the Linux VMs: https://chrome-internal.googlesource.com/infradata/config/+/refs/heads/main/configs/chromium-swarm/starlark/bots/flutter.star#161
Roll `avd_cipd_verison` to latest to use the `crashreport` tool. (#15…
Move Android API level 35 emulator tests to staging
matanlurey commentedon Aug 16, 2024
Unfortunately the solution here is, at the moment, "don't use Android 35 on emulators".
We will revisit adding them about 1 quarter after the public release, and keep the tasks
bringup: truefor now.matanlurey commentedon Aug 16, 2024
Forked a P2 issue here: #153570.
Move Android API level 35 emulator tests to staging (#153568)
Roll `avd_cipd_verison` to latest to use the `crashreport` tool. (flu…
Move Android API level 35 emulator tests to staging (flutter#153568)
github-actions commentedon Aug 30, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.