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.
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:)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With