几个小时后运行CTS时,与设备的adb连接变得无响应 [英] When I run CTS after a few hours the adb connection to device becomes unresponsive

查看:384
本文介绍了几个小时后运行CTS时,与设备的adb连接变得无响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Jacinto 6评估模块(ti-jacinto6evm)上执行CTS,我我遇到了许多我不了解的测试用例失败.

I am executing CTS on Jacinto 6 Evaluation Module (ti-jacinto6evm) and I'm encountering a number of test case failures that I don't understand.

我首先构建了AOSP和CTS.两个版本都很好.我可以刷新测试硬件(ti-jacinto6evm),然后按照说明设置CTS.我在同一台设备上运行CTS超过10次,每次得到不同的结果. ti-jacinto6设备在测试用例执行期间随机挂起.

I started by building both AOSP and CTS. Both builds were just fine. I can flash my test hardware (ti-jacinto6evm) and then I followed the instructions for setting up CTS. I have run CTS for more then 10 times on the same device and every time I got different results. The ti-jacinto6 device randomly gets hanged during execution of the test cases.

大多数时间目标都被挂起,并显示以下错误:

Most of the time target gets hanged and it show following error:

Reason: 'Failed to receive adb shell test output within 600000 ms. Test may have timed out, or adb connection to device became unresponsive'. Check device logcat for details  

Device 170090035a700002 shell is unresponsive
05-30 04:52:21 W/TestInvocation: Invocation did not complete due to device 170090035a700002 becoming not available. Reason: Could not find device 170090035a700002

在以下测试案例中,我的目标挂起了:

on the below test cases my target hangs:

CtsPreference2TestCases
CtsUiHostTestCases
CtsServicesHostTestCases
CtsTrustedVoiceHostTestCases
CtsTransitionTestCases
CtsAppTestCases
CtsGraphicsTestCases
CtsCameraTestCases
CtsWebkitTestCases
CtsFragmentTestCases
CtsViewTestCases 

所以我只是从CTS中排除了这些测试用例,然后再次使用以下命令运行了CTS:

So I just excluded those test cases from the CTS and again ran CTS with the following command:

 run cts --skip-preconditions --exclude-filter CtsPreference2TestCases --exclude-filter CtsServicesHostTestCases --exclude-filter CtsUiHostTestCases --exclude-filter CtsTrustedVoiceHostTestCases --exclude-filter CtsAppTestCases --exclude-filter CtsGraphicsTestCases --exclude-filter CtsTransitionTestCases --exclude-filter CtsCameraTestCases --exclude-filter CtsWebkitTestCases --exclude-filter CtsFragmentTestCases --plan cts

问题1

我遇到的问题是某些测试用例第一次可以正常运行,但是当我第二次运行CTS时,它们无法通过某些测试用例.

Problem 1

I am facing a problem where some test cases are running properly for the first time, but when I run CTS for the second time, they fail some passed test case(s).

第一次迭代.在此迭代中,通过了166个模块:

1st iteration. On this iteration 166 modules passed:

Testcase name
Passed
Failed 
Total executed 
armeabi-v7a CtsWebkitTestCases
201
12
213

第二次迭代.在这次迭代中,通过了91个模块:

2nd iteration. On this iteration 91 modules passed:

Testcase name
Passed
Failed 
Total executed 
armeabi-v7a CtsWebkitTestCases
80
1
81

问题2

当CTS卡在某些测试用例上时,它会显示TimeoutException:

com.android.ddmlib.TimeoutException
    at com.android.ddmlib.AdbHelper.read(AdbHelper.java:767)
    at com.android.ddmlib.AdbHelper.read(AdbHelper.java:736)
    at com.android.ddmlib.AdbHelper.readAdbResponse(AdbHelper.java:222)
    at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:456)
    at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:382)
    at com.android.ddmlib.Device.executeShellCommand(Device.java:617)
    at com.android.tradefed.device.NativeDeviceStateMonitor.waitForDeviceShell(NativeDeviceStateMonitor.java:170)
    at com.android.tradefed.device.WaitDeviceRecovery.recoverDevice(WaitDeviceRecovery.java:142)
    at com.android.tradefed.device.NativeDevice.recoverDevice(NativeDevice.java:1720)
    at com.android.tradefed.device.NativeDevice.performDeviceAction(NativeDevice.java:1661)
    at com.android.tradefed.device.NativeDevice.runInstrumentationTests(NativeDevice.java:615)
    at com.android.tradefed.device.NativeDevice.runInstrumentationTests(NativeDevice.java:698)
    at com.android.tradefed.testtype.InstrumentationTest.runWithRerun(InstrumentationTest.java:797)
    at com.android.tradefed.testtype.InstrumentationTest.doTestRun(InstrumentationTest.java:740)
    at com.android.tradefed.testtype.InstrumentationTest.run(InstrumentationTest.java:643)
    at com.android.tradefed.testtype.AndroidJUnitTest.run(AndroidJUnitTest.java:233)
    at com.android.compatibility.common.tradefed.testtype.ModuleDef.run(ModuleDef.java:250)
    at com.android.compatibility.common.tradefed.testtype.CompatibilityTest.run(CompatibilityTest.java:506)
    at com.android.tradefed.invoker.TestInvocation.runTests(TestInvocation.java:761)
    at com.android.tradefed.invoker.TestInvocation.prepareAndRun(TestInvocation.java:446)
    at com.android.tradefed.invoker.TestInvocation.performInvocation(TestInvocation.java:300)
    at com.android.tradefed.invoker.TestInvocation.invoke(TestInvocation.java:886)
    at com.android.tradefed.command.CommandScheduler$InvocationThread.run(CommandScheduler.java:567)

此失败的原因是什么?

推荐答案

无需重新运行已经过去的测试,您可以继续运行,仅运行失败或未运行的测试,请使用命令

No need to rerun the tests that already past you can continue and run only the tests that failed or were not ran, use command

l r 

获取结果,然后使用运行的第一列号会话ID继续进行测试,如下所示:

to get the results and then use the first column number session id of the run to continue test from like this:

 run cts --retry 12

其中,12是显示在l r第一栏中的运行会话ID.

where 12 is the run session id displayed in the first column of l r.

adb断开连接确实会影响测试用例,我使用此小脚本重新连接,您可以对其进行修改以适合您的需求.

adb disconnection indeed can affect the test cases, I use this small script to reconnect, you can modify it to suit your needs.

cat adb_retry.sh:

while : 
do
if ((`adb devices  | wc -l` < 3 )); then
echo Connection for $1 droped out 
echo retrying
adb connect "$1"
fi
sleep 5
echo Watching... 
done

这篇关于几个小时后运行CTS时,与设备的adb连接变得无响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆