2016-09-22 1 views
8

로컬 에뮬레이터에서 계측 테스트를 실행하면 10 번 중 10 번 완벽하게 실행되지만 Travis CI의 AVD에서 동일한 테스트를 실행하려고하면 무작위로 난 단지 무작위로 트래비스에 무슨 일이 일어나고 여전히 진행 바, 모든하지만 문제를 제거하는 시도안드로이드 계측 테스트가 Travis CI AVD에서 실패하지만 로컬 에뮬레이터에서 작동

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.

얻을. 내 travis.yml은 다음과 같습니다

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 

답변

0

당신은 에뮬레이터가 준비되면, remove-no-boot-anim 옵션이 depends on 감지하시기 바랍니다 android-wait-for-emulator 스크립트를 사용합니다.

는 다른 방법으로,이 같은 고정 sleep time하여 android-wait-for-emulator 스크립트를 대체 :

- sleep 300 
    - adb shell input keyevent 82 & 

는 각 API 부트 기간에 따라 수면 시간을 선택해야합니다.

관련 문제