JAVA中cts时间,几个小时后运行CTS时,与设备的adb连接无响应

Jacinto 6上CTS测试问题及解决方案
博主在Jacinto 6评估模块上执行CTS测试时遇到问题,包括测试用例随机失败、设备挂起、部分用例首次通过二次失败、测试卡住报超时异常等。给出解决方案,如用特定命令继续未通过或未运行的测试,用脚本处理adb断开连接问题。

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.

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

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

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).

1st iteration. On this iteration 166 modules passed:

Testcase name

Passed

Failed

Total executed

armeabi-v7a CtsWebkitTestCases

201

12

213

2nd iteration. On this iteration 91 modules passed:

Testcase name

Passed

Failed

Total executed

armeabi-v7a CtsWebkitTestCases

80

1

81

Problem 2

When CTS gets stuck on some testcases it shows a 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)

What is the reason behind this failure?

解决方案

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

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

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

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的AutoFill相关测试中发现两项超报错android.autofillservice.cts.saveui.AutofillSaveDialogTest#testSuppressSaveDialog_onMixedFields_withIsCredential FAILURE: com.android.compatibility.common.util.RetryableException: onFillRequest() not called (timeout=FILL_TIMEOUT: [current=20000ms; multiplier=2.0x; max=20000ms]) at android.autofillservice.cts.testcore.InstrumentedAutoFillService$Replier.getNextFillRequest(InstrumentedAutoFillService.java:575) at android.autofillservice.cts.saveui.AutofillSaveDialogTest.testSuppressSaveDialog_onMixedFields(AutofillSaveDialogTest.java:430) at android.autofillservice.cts.saveui.AutofillSaveDialogTest.testSuppressSaveDialog_onMixedFields_withIsCredential(AutofillSaveDialogTest.java:253) 和android.autofillservice.cts.saveui.AutofillSaveDialogTest#testSuppressSaveDialog_onOnlyCredmanFields_withIsCredential FAILURE: com.android.compatibility.common.util.RetryableException: onFillRequest() not called (timeout=FILL_TIMEOUT: [current=20000ms; multiplier=2.0x; max=20000ms]) at android.autofillservice.cts.testcore.InstrumentedAutoFillService$Replier.getNextFillRequest(InstrumentedAutoFillService.java:575) at android.autofillservice.cts.saveui.AutofillSaveDialogTest.testSuppressSaveDialog_OnCredmanOnlyFields(AutofillSaveDialogTest.java:389) at android.autofillservice.cts.saveui.AutofillSaveDialogTest.testSuppressSaveDialog_onOnlyCredmanFields_withIsCredential(AutofillSaveDialogTest.java:244)设置的等待时间为20秒,测试机上没有插入电话卡,在不延长等待时间的情况下,如何解决这两个fail项
03-29
Line 3507: 01-01 19:26:38.540 01744 01744 I adbd : persist.adb.watchdog set to '' Line 3508: 01-01 19:26:38.542 01744 01744 I adbd : persist.sys.test_harness set to '' Line 3510: 01-01 19:26:38.542 01744 01744 I adbd : adb watchdog timeout set to 600 seconds Line 3511: 01-01 19:26:38.543 01744 01744 I adbd : adbd started Line 3511: 01-01 19:26:38.543 01744 01744 I adbd : adbd started Line 3513: 01-01 19:26:38.543 01744 01759 I adbd : opening control endpoint /dev/usb-ffs/adb/ep0 Line 3514: 01-01 19:26:38.544 01744 01757 I adbd : Waiting for persist.adb.tls_server.enable=1 Line 3517: 01-01 19:26:38.554 01744 01759 I adbd : UsbFfsConnection constructed Line 3526: 01-01 19:26:38.570 01744 01761 I adbd : UsbFfs-monitor thread spawned Line 4331: 01-01 19:26:39.572 01744 01761 W adbd : timed out while waiting for FUNCTIONFS_BIND, trying again Line 4332: 01-01 19:26:39.572 01744 01761 I adbd : UsbFfs: connection terminated: monitor thread finished Line 4333: 01-01 19:26:39.573 01744 01744 I adbd : UsbFfs: already offline Line 4334: 01-01 19:26:39.573 01744 01744 I adbd : destroying transport UsbFfs Line 4335: 01-01 19:26:39.573 01744 01744 I adbd : UsbFfsConnection being destroyed Line 4353: 01-01 19:26:39.642 01744 01759 I adbd : opening control endpoint /dev/usb-ffs/adb/ep0 Line 4355: 01-01 19:26:39.648 01744 01759 I adbd : UsbFfsConnection constructed Line 4363: 01-01 19:26:39.652 01744 01965 I adbd : UsbFfs-monitor thread spawned Line 6044: 01-01 19:26:40.669 01744 01965 W adbd : timed out while waiting for FUNCTIONFS_BIND, trying again Line 6045: 01-01 19:26:40.669 01744 01965 I adbd : UsbFfs: connection terminated: monitor thread finished Line 6046: 01-01 19:26:40.670 01744 01744 I adbd : UsbFfs: already offline Line 6047: 01-01 19:26:40.670 01744 01744 I adbd : destroying transport UsbFfs Line 6048: 01-01 19:26:40.670 01744 01744 I adbd : UsbFfsConnection being destroyed Line 6641: 01-01 19:26:40.810 01744 01759 I adbd : opening control endpoint /dev/usb-ffs/adb/ep0 Line 6703: 01-01 19:26:40.815 01744 01759 I adbd : UsbFfsConnection constructed Line 6726: 01-01 19:26:40.820 01744 02220 I adbd : UsbFfs-monitor thread spawned Line 7858: 01-01 19:26:41.384 01744 02220 I adbd : USB event: FUNCTIONFS_BIND Line 12899: 01-01 19:26:45.298 02952 02958 E Diag_Lib: DPL : gIsQXDMDisabled 0, gIsADBDisabled 0, gIsDebugDisabled 0, gIsIMSLogsDisabled 0 gIsDebugDataPathDisabled = 0 Line 13319: 01-01 19:26:45.317 02952 02958 E Diag_Lib: DPL : gIsQXDMDisabled 0, gIsADBDisabled 0, gIsDebugDisabled 0, gIsIMSLogsDisabled 0 gIsDebugDataPathDisabled = 0 Line 13978: 01-01 19:26:45.534 02924 02924 D CompatConfig: No directory /apex/com.android.adbd/etc/compatconfig, skipping Line 17407: 01-01 19:26:47.093 02924 02924 W PackageManager: No package known for package restrictions com.google.android.adbd Line 17766: 01-01 19:26:47.274 02924 02924 D PackageManager: Directories scanned as system partitions: [/system:0, /vendor:524288, /odm:4194304, /oem:262144, /product:1048576, /system_ext:2097152, /my_product/non_overlay:1048576, /mnt/opex/com.oplus.odmf@15002009:2097152, /mnt/opex/com.oplus.moduleservices@15000014:2097152, /mnt/opex/com.oplus.fancyIconLoader@1000000:2097152, /mnt/opex/com.oplus.NetworkAssistSys@15002031:2097152, /mnt/opex/com.oplus.CustCore@15000029:2097152, /my_company:1048576, /my_carrier:1048576, /my_bigball:1048576, /my_product/cust/TR:1048576, /apex/com.android.ipsec:41943040, /apex/com.android.ondevicepersonalization:41943040, /apex/com.android.cellbroadcast:41943040, /apex/com.android.profiling:41943040, /apex/com.android.nfcservices:41943040, /apex/com.android.media.swcodec:41943040, /apex/com.android.conscrypt:41943040, /apex/vendor.oplus.hardware.stability.aidl:42467328, /apex/com.android.os.statsd:41943040, /apex/com.android.wifi:41943040, /apex/com.android.uwb:41943040, /apex/com.android.virt:41943040, /apex/com.android.adservices:41943040, /apex/com.android.configinfrastructure:41943040, /apex/com.android.devicelock:41943040, /apex/com.android.appsearch:41943040, /apex/com.google.mainline.primary.libs:41943040, /apex/com.android.compos:44040192, /apex/com.android.tethering:41943040, /apex/com.android.resolv:41943040, /apex/com.android.mediaprovider:41943040, /apex/com.android.runtime:41943040, /apex/com.android.neuralnetworks:41943040, /apex/com.android.permission:41943040, /apex/com.android.adbd:41943040, /apex/com.android.i18n:41943040, /apex/com.android.scheduling:41943040, /apex/com.android.media:41943040, /apex/com.android.tzdata:41943040, /apex/vendor.oplus.hardware.engineer.aidl:42467328, /apex/com.android.sdkext:41943040, /apex/com.android.rkpd:41943040, /apex/com.android.apex.cts.shim:41943040, /apex/com.android.art:41943040, /apex/com.android.extservices:41943040, /apex/com.android.vndk.v33:44040192, /apex/com.android.healthfitness:41943040] Line 17819: 01-01 19:26:47.410 02924 02924 I PackageManager: /data/apex/decompressed/com.android.adbd@351010000.decompressed.apex changed; collecting certs Line 17823: 01-01 19:26:47.422 02924 02924 E PackageManagerServiceUtilsExtImpl: Fix up user restrict data of pkg: com.google.android.adbd Line 19413: 01-01 19:26:51.224 02924 02924 D PackageManager: No files in app dir /apex/com.android.adbd/priv-app Line 19414: 01-01 19:26:51.224 02924 02924 D PackageManager: No files in app dir /apex/com.android.adbd/app Line 20634: 01-01 19:26:52.985 02924 02924 W PackageSettings: Couldn't write -1 to /config/sdcardfs/com.google.android.adbd/appid Line 21520: 01-01 19:26:53.270 02924 02924 D OverlayManager: -> Updating overlay: target=com.google.android.adbd overlays=[OverlayPaths { resourceDirs = [], overlayPaths = [/data/resource-cache/com.android.systemui-neutral-coSn.frro, /data/resource-cache/com.android.systemui-accent-n7sV.frro, /data/resource-cache/com.android.systemui-dynamic-EysW.frro] }] userId=0 Line 29901: 01-01 19:26:55.625 02924 03113 I UsbDeviceManager: failed to write to /sys/class/android_usb/android0/f_rndis/ethaddr Line 29902: 01-01 19:26:55.626 02924 03113 D UsbPortManager: Querying USB Gadget HAL version Line 29915: 01-01 19:26:55.630 02924 03113 E UsbDeviceManager: connectToProxy: usb gadget hidl hal service not found. Line 29922: at com.android.server.usb.UsbDeviceManager.<init>(UsbDeviceManager.java:332) Line 29922: at com.android.server.usb.UsbDeviceManager.<init>(UsbDeviceManager.java:332) Line 29935: 01-01 19:26:55.630 02924 03113 E UsbPortManager: USB Gadget HAL AIDL/HIDL not present Line 29936: 01-01 19:26:55.630 02924 03113 D UsbDeviceManager: getInstance done Line 29946: 01-01 19:26:55.636 02924 03113 I UsbDeviceManager: mResetUsbGadgetDisableDebounce:false connected:0configured:0 Line 29948: 01-01 19:26:55.636 02924 03113 I UsbDeviceManager: removeMessages MSG_UPDATE_STATE Line 30039: 01-01 19:26:55.647 02924 03113 D UsbPortManager: Querying USB HAL version Line 30082: 01-01 19:26:55.658 02924 03113 I UsbPortManager: USB HAL HIDL present Line 30093: 01-01 19:26:55.665 02924 03304 I UsbPortManager: Usb hal service started android.hardware.usb@1.0::IUsb default Line 30103: 01-01 19:26:55.671 02924 03113 D UsbPortManager: getInstance done Line 33157: 01-01 19:26:56.637 02924 02969 I UsbDeviceManager: handleMessage MSG_UPDATE_STATE mConnected:false mConfigured:false Line 46190: 01-01 19:26:58.809 02924 03298 D UsbDeviceManager: systemReady Line 46192: 01-01 19:26:58.810 02924 02969 D UsbDeviceManager: UsbBootInfo: [mSystemReady: true, mBootCompleted: false, mConnected: false, mConfigured: false, mCurrentUsbFunctionsReceived: true, mPendingBootBroadcast: true, mScreenLocked: true, screenUnlockedFunctions: , isAdbEnabled: true] Line 46221: 01-01 19:26:58.814 02924 03304 I UsbPortManager: ClientCallback V1_2: port0 Line 46245: 01-01 19:26:58.818 02924 02969 I UsbPortManager: USB port added: port=UsbPort{id=port0, supportedModes=dual, audio_acc, supportedContaminantProtectionModes=0, supportsEnableContaminantPresenceProtection=false, supportsEnableContaminantPresenceDetection=false, supportsComplianceWarnings=false, status=UsbPortStatus{connected=true, currentMode=ufp, currentPowerRole=sink, currentDataRole=device, supportedRoleCombinations=[source:host, sink:device], contaminantDetectionStatus=0, contaminantProtectionStatus=0, usbDataStatus=unknown, isPowerTransferLimited=false, powerBrickConnectionStatus=unknown, complianceWarnings=[], plugState=0, displayPortAltModeInfo=null}, canChangeMode=true, canChangePowerRole=false, canChangeDataRole=false, connectedAtMillis=36033, lastConnectDurationMillis=0 Line 70581: 01-01 19:27:06.142 02924 02972 V UsbDeviceManager: onKeyguardStateChanged: isShowing:true secure:false user:0 Line 72918: 01-01 19:27:07.024 02924 02924 I UsbDeviceManager: updateHostState UsbPort{id=port0, supportedModes=dual, audio_acc, supportedContaminantProtectionModes=0, supportsEnableContaminantPresenceProtection=false, supportsEnableContaminantPresenceDetection=false, supportsComplianceWarnings=false status=UsbPortStatus{connected=true, currentMode=ufp, currentPowerRole=sink, currentDataRole=device, supportedRoleCombinations=[source:host, sink:device], contaminantDetectionStatus=0, contaminantProtectionStatus=0, usbDataStatus=unknown, isPowerTransferLimited=false, powerBrickConnectionStatus=unknown, complianceWarnings=[], plugState=0, displayPortAltModeInfo=null} Line 77542: 01-01 19:27:08.412 02924 02972 D UsbDeviceManager: boot completed Line 77613: 01-01 19:27:08.420 02924 02969 D UsbDeviceManager: UsbBootInfo: [mSystemReady: true, mBootCompleted: true, mConnected: false, mConfigured: false, mCurrentUsbFunctionsReceived: true, mPendingBootBroadcast: true, mScreenLocked: false, screenUnlockedFunctions: , isAdbEnabled: true] Line 77621: 01-01 19:27:08.421 02924 02969 D UsbDeviceManager: broadcasting Intent { act=android.hardware.usb.action.USB_STATE flg=0x31100000 (has extras) } extras: Bundle[{host_connected=false, connected=false, unlocked=false, adb=true, configured=false}] Line 77637: 01-01 19:27:08.423 02924 02969 D UsbDeviceManager: setEnabledFunctions [functions= ,forceRestart=false ,usbDataUnlocked=false ,mUsbDataUnlocked=false ,operationId=6] Line 77692: 01-01 19:27:08.444 02924 02969 D UsbDeviceManager: oplusFunctions: adb Line 77696: 01-01 19:27:08.446 02924 02969 D UsbDeviceManager: UsbFunc: [functions: adb, oemFunctions: adb, mCurrentFunctionsStr: adb, mCurrentOemFunctions: adb, forceRestart: false, mCurrentFunctionsApplied: true] Line 77700: 01-01 19:27:08.446 02924 02969 D UsbDeviceManager: updateMtpFunction , mtpEnabled: false, ptpEnabled: false, mIsMtpServiceBound: false Line 77814: 01-01 19:27:08.471 01744 01758 I adbd : adbd_auth: received a new framework connection Line 77814: 01-01 19:27:08.471 01744 01758 I adbd : adbd_auth: received a new framework connection Line 77815: 01-01 19:27:08.472 01744 01758 I adbd : adbd_auth: received new framework fd 16 (current = -1) Line 77815: 01-01 19:27:08.472 01744 01758 I adbd : adbd_auth: received new framework fd 16 (current = -1) Line 81135: 01-01 19:27:09.113 04893 04893 D vold_prepare_subdirs: Setting up mode 771 uid 0 gid 1000 context u:object_r:apex_module_data_file:s0 on path: /data/misc_ce/0/apexdata/com.android.adbd Line 82329: 01-01 19:27:09.362 02924 04870 W PackageManager: Skipping preparing app data for com.google.android.adbd Line 83351: 01-01 19:27:09.715 02924 02996 V UsbDeviceManager: onKeyguardStateChanged: isShowing:false secure:false user:0 分析adb链接中断原因
最新发布
08-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值