[Google CTS]Fail Case:CtsAppSecurityHostTestCases#android.appsecurity.cts.DirectBootHostTest#testDirectBootEmulated
Android P
测试套件:9.0_R5
项目中由于vdf需求,做了GMS overlay,导致此项cts测试failed
failed information:
CtsAppSecurityHostTestCases
android.appsecurity.cts.DirectBootHostTest#testDirectBootEmulated fail
java.lang.AssertionError: Failed to successfully run device tests for com.android.cts.encryptionapp: Instrumentation run failed due to 'Process crashed.'
failed logcat:
1-14 23:38:27.338 4537 4569 I TestRunner: failed: testTearDown(com.android.cts.encryptionapp.EncryptionAppTest)
01-14 23:38:27.338 4537 4569 I TestRunner: ----- begin exception -----
01-14 23:38:27.343 4537 4569 I TestRunner: java.lang.RuntimeException: Error while connecting UiAutomation
01-14 23:38:27.343 4537 4569 I TestRunner: at android.app.UiAutomation.connect(UiAutomation.java:250)
01-14 23:38:27.343 4537 4569 I TestRunner: at android.app.Instrumentation.getUiAutomation(Instrumentation.java:2116)
01-14 23:38:27.343 4537 4569 I TestRunner: at android.support.test.uiautomator.UiDevice.getUiAutomation(UiDevice.java:1129)
01-14 23:38:27.343 4537 4569 I TestRunner: at android.support.test.uiautomator.QueryController.<init>(QueryController.java:95)
01-14 23:38:27.343 4537 4569 I TestRunner: at android.support.test.uiautomator.UiDevice.<init>(UiDevice.java:109)
01-14 23:38:27.343 4537 4569 I TestRunner: at android.support.test.uiautomator.UiDevice.getInstance(UiDevice.java:261)
01-14 23:38:27.343 4537 4569 I TestRunner: at com.android.cts.encryptionapp.EncryptionAppTest.setUp(EncryptionAppTest.java:74)
01-14 23:38:27.343 4537 4569 I TestRunner: at junit.framework.TestCase.runBare(TestCase.java:132)
01-14 23:38:27.343 4537 4569 I TestRunner: at junit.framework.TestResult$1.protect(TestResult.java:115)
01-14 23:38:27.343 4537 4569 I TestRunner: at android.support.test.internal.runner.junit3.AndroidTestResult.runProtected(AndroidTestResult.java:73)
01-14 23:38:27.343 4537 4569 I TestRunner: at junit.framework.TestResult.run(TestResult.java:118)
01-14 23:38:27.343 4537 4569 I TestRunner: at android.support.test.internal.runner.junit3.AndroidTestResult.run(AndroidTestResult.java:51)
01-14 23:38:27.343 4537 4569 I TestRunner: at junit.framework.TestCase.run(TestCase.java:124)
01-14 23:38:27.343 4537 4569 I TestRunner: at android.support.test.internal.runner.junit3.NonLeakyTestSuite$NonLeakyTest.run(NonLeakyTestSuite.java:62)
01-14 23:38:27.343 4537 4569 I TestRunner: at android.support.test.internal.runner.junit3.AndroidTestSuite$2.run(AndroidTestSuite.java:101)
01-14 23:38:27.343 4537 4569 I TestRunner: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
01-14 23:38:27.343 4537 4569 I TestRunner: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
01-14 23:38:27.343 4537 4569 I TestRunner: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
01-14 23:38:27.343 4537 4569 I TestRunner: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
01-14 23:38:27.343 4537 4569 I TestRunner: at java.lang.Thread.run(Thread.java:764)
01-14 23:38:27.343 4537 4569 I TestRunner: ----- end exception -----
01-14 23:38:27.345 4537 4569 I TestRunner: finished: testTearDown(com.android.cts.encryptionapp.EncryptionAppTest)
01-14 23:38:27.361 4537 4537 I MonitoringInstr: Activities that are still in CREATED to STOPPED: 0
01-14 23:38:27.362 4537 4561 I TestRunner: run finished: 1 tests, 1 failed, 0 ignored
01-14 23:38:27.366 4537 4561 E AndroidRuntime: FATAL EXCEPTION: Instr: android.support.test.runner.AndroidJUnitRunner
01-14 23:38:27.366 4537 4561 E AndroidRuntime: Process: com.android.cts.encryptionapp, PID: 4537
01-14 23:38:27.366 4537 4561 E AndroidRuntime: java.lang.IllegalStateException: UiAutomation not connected!
01-14 23:38:27.366 4537 4561 E AndroidRuntime: at android.app.UiAutomation.throwIfNotConnectedLocked(UiAutomation.java:1112)
01-14 23:38:27.366 4537 4561 E AndroidRuntime: at android.app.UiAutomation.disconnect(UiAutomation.java:286)
01-14 23:38:27.366 4537 4561 E AndroidRuntime: at android.app.Instrumentation.finish(Instrumentation.java:244)
01-14 23:38:27.366 4537 4561 E AndroidRuntime: at android.support.test.runner.MonitoringInstrumentation.finish(MonitoringInstrumentation.java:334)
01-14 23:38:27.366 4537 4561 E AndroidRuntime: at android.support.test.runner.AndroidJUnitRunner.finish(AndroidJUnitRunner.java:409)
01-14 23:38:27.366 4537 4561 E AndroidRuntime: at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:398)
01-14 23:38:27.366 4537 4561 E AndroidRuntime: at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2145)
01-14 23:38:27.377 4537 4561 I Process : Sending signal. PID: 4537 SIG: 9
01-14 23:38:27.506 913 1961 I ActivityManager: Killing 4335:com.mediatek.engineermode/1001 (adj 906): empty #13
01-14 23:38:27.589 487 487 I Zygote : Process 4335 exited due to signal (9)
01-14 23:38:27.617 489 489 I Zygote : Process 4537 exited due to signal (9)
01-14 23:38:27.618 913 924 I ActivityManager: Process com.android.cts.encryptionapp (pid 4537) has died: fore FGS
01-14 23:38:27.618 913 924 W ActivityManager: Crash of app com.android.cts.encryptionapp running instrumentation ComponentInfo{com.android.cts.encryptionapp/android.support.test.runner.AndroidJUnitRunner}
01-14 23:38:27.619 913 924 I ActivityManager: Force stopping com.android.cts.encryptionapp appid=10147 user=0: finished inst
01-14 23:38:27.620 4500 4534 W Binder : java.lang.SecurityException: Calling from not trusted UID!
01-14 23:38:27.620 4500 4534 W Binder : at android.app.UiAutomationConnection.throwIfCalledByNotTrustedUidLocked(UiAutomationConnection.java:468)
01-14 23:38:27.620 4500 4534 W Binder : at android.app.UiAutomationConnection.shutdown(UiAutomationConnection.java:372)
01-14 23:38:27.620 4500 4534 W Binder : at android.app.IUiAutomationConnection$Stub.onTransact(IUiAutomationConnection.java:222)
01-14 23:38:27.620 4500 4534 W Binder : at android.os.Binder.execTransact(Binder.java:731)
UiAutomation connect问题失败导致测试无法继续进行
connect UiAutomation 超時,導致 鏈接failed,測試失敗
可以考慮增加timeout的時間來嘗試讓其connect 成功就可以pass了
解决方法
frameworks / base/core/java/android/app/UiAutomation.java
private static final long CONNECT_TIMEOUT_MILLIS = 15000;
增大CONNECT_TIMEOUT_MILLIS的值,测试可以pass