2016-09-22 18 views
8

Yerel emülatörümde enstrümantasyon testleri çalıştırırsam 10 kez 10 kez 10 kez çalışırım ama aynı testleri Travis CI'da bir AVD'de çalıştırmaya çalıştığımda rastgele sadece rastgele ve Travis neler olup hala tüm ilerleme çubukları ve herşeyi ama onun bir sorun çıkarmadan denediAndroid Instrumentation Test, Travis CI AVD'de başarısız oldu ancak yerel emülatörde çalışıyor

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.

olsun. Benim travis.yml şöyle görünür:

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 

cevap

0

Eğer emülatör hazır olduğunda, remove-no-boot-anim seçenek depends on algılamak için lütfen android-wait-for-emulator senaryoyu kullanmak istiyorsanız.

Alternatif böyle bir sabit sleep time tarafından android-wait-for-emulator senaryoyu değiştirin:

- sleep 300 
    - adb shell input keyevent 82 & 

Her API çizme süresi temel alınarak uyku süresini seçmek gerekir.

İlgili konular