2016-07-21 2 views
3

Jenkins 및 Espresso 테스트를 실행할 때 특정 팀원 컴퓨터에서 아래 오류가 표시됩니다. 이 오류를 검색하여 시간 초과 또는 일부 애니메이션과 관련이 있음을 확인했습니다. 모든 기기에는 애니메이션이 꺼져 있습니다.Android/Espresso 테스트 실행시 의도 오류

예를 들어 지난 주에이 문제가 발생하여 Android Studio를 모두 제거하고 코드를 제거한 다음 다시 설치했습니다. 그것은 작동하지 않았다. 나는 또한 자바와 JDK를 업그레이드했다. 그 후에 나는 여전히이 문제를 겪고 있었다. 그러던 어느 날 그냥 효과가있었습니다. 나는 이유를 모른다.

이제 내 동료가이 문제를 겪고 있습니다. 하나의 장치 (5.1)가 아닌 다른 장치 (6.0)에 대해이 문제가 발생했습니다. 다른 동료가 정반대의 문제를 겪고 있습니다.

제 질문은 - 무엇을 확인할 수 있습니까? 어떤 조치를 취해야합니까? 모든 IDE는 버전 번호 및 빌드 도구와 일치합니다. 나는 아이디어가 부족하다.

감사합니다.

java.lang.RuntimeException: Could not launch intent Intent { act=android.intent.action.MAIN flg=0x14000000 cmp=com.COMPANY.espresso/com.COMPANY.activity.LauncherActivity } 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 1469050322683 and now the last time the queue went idle was: 1469050322683. If these numbers are the same your activity might be hogging the event queue. 
at android.support.test.runner.MonitoringInstrumentation.startActivitySync(MonitoringInstrumentation.java:360) 
at android.support.test.rule.ActivityTestRule.launchActivity(ActivityTestRule.java:219) 
at android.support.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:268) 
at org.junit.rules.RunRules.evaluate(RunRules.java:20) 
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) 
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) 
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) 
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) 
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) 
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) 
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) 
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) 
at org.junit.runners.ParentRunner.run(ParentRunner.java:363) 
at org.junit.runners.Suite.runChild(Suite.java:128) 
at org.junit.runners.Suite.runChild(Suite.java:27) 
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) 
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) 
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) 
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) 
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) 
at org.junit.runners.ParentRunner.run(ParentRunner.java:363) 
at org.junit.runner.JUnitCore.run(JUnitCore.java:137) 
at org.junit.runner.JUnitCore.run(JUnitCore.java:115) 
at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:59) 
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:262) 
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1862) 
+0

앱을 시작할 때 어떤 기능을합니까? 백그라운드에서 코드를 실행합니까? 'Application.onCreate()'에서 어떤 일이 일어나고'LauncherActivity'의'onCreate','onStart'와'onResume'이 실행될 때? 당신은 불확실한'ProgressBar'를 보여 줍니까? 'LauncherActivity'의 코드와 그 레이아웃과'Application'의'onCreate'를 게시하십시오. – thaussma

+0

코드를 표시 할 수는 없지만 Google의 앱은 백그라운드 네트워크 요청, 인증을 수행하며 일부 싱글 톤을 설정합니다. 또한로드 표시기를 보여줍니다. – Skycamefalling

+0

화면 잠금을 해제하기 위해 장치에 보안이되어 있지 않은지 확인하십시오. 검사가 시작되기 전에 화면 잠금이 해제되어 있는지 확인하십시오. – gorbysbm

답변

1

내 첫번째 추측이며, 그 ProgressBar 블록 에스프레소와 Activity의 내용 뷰가 불확정 ProgressBar을 포함, 즉 항상 표시하거나 onResume 돌아 가기 전에 볼이된다. 애니메이션은 App Busy를 유지하고 Espresso는 시간이 초과 될 때까지 대기합니다. 이렇게하면 게시 한 오류가 정확하게 발생합니다.

테스트가 가끔 작동하기 때문에 ProgressBar의 가시성이 백그라운드 작업에 의존한다고 가정합니다. Espresso가 시간 초과되기 전에 진행률 표시 줄이 숨겨 지거나 (또는 ​​뷰 계층 구조에서 제거 된 경우) 테스트가 실행됩니다.

둘째 추측은 배경 작업에 AsyncTasks을 사용하고 있다는 것입니다. onResume이 반환되기 전에 장시간에 AsyncTasks을 시작하면이 오류가 게시됩니다. ProgressBar 당신이 완전히 제거하거나 정적 인 (즉,이 ColorDrawable)과의 불확정 당김을 대체 할 수있는 이유 인 경우

확인합니다.

1

프로젝트를 정리하고 프로젝트를 만드십시오.

또한 가상 또는 실제 장치에서 시스템 애니메이션을 해제하십시오.