Android Instrumentation Test fail on Travis CI AVD but work on local emulator -


if run instrumentation tests on local emulator run 10 out of 10 times when try run same tests on avd in travis ci, randomly

failed java.lang.runtimeexception: not launch intent intent { } within 45 seconds. perhaps main thread has not gone idle within reasonable amount of time? there animation or repainting screen. or activity doing network calls on creation? see threaddump logs. reference last time event queue idle before activity launch request xxxxxxx , last time queue went idle was: xxxxxxxxx. if these numbers same activity might hogging event queue.

i have tried removing progress bars , still issue happening randomly , on travis. travis.yml looks this:

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 

if want use android-wait-for-emulator script, please remove -no-boot-anim option depends on detect when emulator ready.

alternatively, replace android-wait-for-emulator script fixed sleep time this:

  - sleep 300   - adb shell input keyevent 82 & 

you need choose sleep time based on each api boot duration.


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -