2016-09-22 9 views
8

Jeśli przeprowadzę testy instrumentalne na lokalnym emulatorze, działają one 10 razy z 10 razy, ale gdy próbuję uruchomić te same testy na AVD w Travis CI, losowo dostaćTestowanie systemu Android kończy się niepowodzeniem w Travis CI AVD, ale pracuję nad emulatorem lokalnym

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.

próbowałem usuwając wszystkie paski postępu i wszystko, ale wciąż jej problem, który dzieje się przypadkowo i tylko na Travisa. Moja travis.yml wygląda następująco:

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 

Odpowiedz

0

Jeśli chcesz użyć android-wait-for-emulator skrypt, proszę remove opcja -no-boot-anim to depends on wykryć gdy emulator jest gotowy.

Ewentualnie zastąpić skrypt android-wait-for-emulator o stałą sleep time tak:

- sleep 300 
    - adb shell input keyevent 82 & 

Musisz wybrać czas snu w oparciu o czas trwania każdego API rozruchowej.

Powiązane problemy