If I run control tests on my local emulator, they work fine 10 out of 10 times, but when I try to run the same tests on AVD in Travis CI, I accidentally get
FAILED java.lang.RuntimeException: Could not launch intent Intent { } within 45 seconds. Perhaps the main thread has not gone idle within a reasonable amount of time? There could be an animation or something constantly repainting the screen. Or the activity is doing network calls on creation? See the threaddump logs. For your reference the last time the event queue was idle before your activity launch request was xxxxxxx and now the last time the queue went idle was: xxxxxxxxx. If these numbers are the same your activity might be hogging the event queue.
I tried to remove all progress bars and everything, but still this is a problem that happens only randomly and on Travis. My travis.yml is as follows:
env: global: - ANDROID_TARGET=android-19 - ANDROID_ABI=armeabi-v7a before_script: - android list targets - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI - emulator -avd test -no-skin -no-audio -no-window -no-boot-anim & - android-wait-for-emulator - adb shell input keyevent 82 & script: - ./gradlew jacocoTestReport assembleAndroidTest connectedCheck zipalignRelease
android travis-ci android-avd instrumentation
Soh
source share