Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to intentionally slow down the emulator?

This question goes the opposite direction than the usual about Android emulators.

My Android instrumentation tests (using Espresso against the RxJava-based app) run just fine on my development machine, but they occasionally fail in the build server.

My build server has a slower hardware than my machine. I think this is causing the actual Espresso checks to be performed before the background tasks have been completed. I'm aware that Espresso, by default, does not wait for RxJava schedulers (io() and computation()) to complete, so that may be the reason.

There are several ways to make Espresso aware of RxJava schedulers, but before implementing them I want to reproduce the problem on my machine.

I've tried disabling hardware acceleration to no avail.

In the configuration you can set the network speed and latency, but in this case I'm interested in throttling down CPU speed. There is no network involved in the failing tests.

like image 882
ris8_allo_zen0 Avatar asked Nov 08 '22 16:11

ris8_allo_zen0


1 Answers

Try to edit configuration of your Emulator in AVD Manager, I just decreased RAM and Cores number and my tests started to fail more often:)

enter image description here

like image 191
vbevans94 Avatar answered Nov 14 '22 23:11

vbevans94