Si j'exécute des tests d'instrumentation sur mon émulateur local, ils fonctionnent parfaitement 10 fois sur 10, mais lorsque j'essaie d'exécuter les mêmes tests sur un AVD dans Travis CI, je obtenir au hasardTest d'instrumentation Android échoue sur Travis CI AVD mais fonctionne sur l'émulateur local
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.
J'ai essayé d'enlever tous les barres de progression et tout, mais encore son une question qui ne passent au hasard et Travis. Mon travis.yml ressemble à ceci:
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