Closed Bug 1309892 Opened 8 years ago Closed 8 years ago

Investigate Android 6.0 x86 emulator test setup

Categories

(Firefox for Android Graveyard :: Testing, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: gbrown, Assigned: gbrown)

Details

The x86 emulator, when run with Android 6.0 or newer, appears to include support for smp. Test execution speed has always been a concern for us and we have been frustrated by the inability of the emulator to make use of more than 1 core. We think this is a particular issue for the mochitest-media suite.

See bug 1287493 for a previous look at Android 6.0 on the arm emulator.
Assignee: nobody → gbrown
After some more research I'm not sure this will help us. The android emulator supports accelerating qemu via kvm, but EC2 uses xen. AFAICT qemu has support for xen nowadays, but I'm not sure that the android emulator can be coerced to use it. (I could not find any information about doing that, in any event.)
I'm not sure either, but I'm curious. When I run locally, without kvm or any acceleration, the x86 emulator with 6.0 feels more snappy than any other emulator I've tried.
I discovered some interesting quirks of the emulator (25.5.2) today. 

There are two kernels included in system images for Android 6+: kernel-qemu and kernel-ranchu. It appears that the emulator requires both kernel files to be present on startup: Even if kernel-ranchu is selected with -kernel, even if kernel-ranchu is specified in hardware-qemu.ini, even if -ranchu is specified, the emulator will not start if kernel-qemu is not found. 

The emulator rejects -smp arguments ("not supported in classic qemu") unless it is using kernel-ranchu. 

A further complication arises if the avd's config.ini has "image.sysdir.1=", as we traditionally do to find system images (system.img, etc) in the avd directory rather than some sub-directory of the sdk. The emulator apparently tries to find <sdk>/<image.sysdir.1>/kernel-ranchu; if not present, classic mode is selected, regardless of -ranchu, -kernel, and -sysdir options. My solution? Set ANDROID_SDK_ROOT=<avd>, image.sysdir.1=, and put kernel-ranchu in the avd directory.

(The emulator -verbose option was very useful in understanding what was happening here.)
On try, I can start the emulator with a 6.0 x86 image without any apparent errors in logs. However, Android never completes booting, and the emulator screen remains blank (black), This happens even without any smp arguments on the command line.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=ee98fdda035cbe78666e187f88126f3a71697378

I don't know what is going wrong, but I can try some variations next week.
Priority: -- → P1
I tried several variations such as:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=32b92020c90a502b294888977987173d3519533d

In all cases, results are just like comment 4 - Android never completes booting, the emulator screen remains blank, and 'adb devices' shows the emulator present, but 'offline'; there are no apparent errors in the verbose emulator log.

I can run the exact same configuration on my laptop without any difficulty whatsoever; it seems like the new x86 emulator (or Android 6?) does not work on aws (or at least the Mozilla aws/docker/taskcluster/ubuntu configuration). I cannot think of what else to try, and I feel like I've put too much time into this already.

I'll try again with a newer x86 emulator and/or Android 6 image revision, perhaps in a few months' time, but for now...
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
btw, there's a typo in comment 3: s/25.5.2/25.2.2/
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.