Robotium 偶尔出现 Test run failed: Instrumentation run failed due to 'Process crashed.'

周冬彬 · 2015年04月23日 · 最后由 叶子 回复于 2015年04月24日 · 2604 次阅读

在运行 robotium 用例时,偶尔有时候会出现 FAIL:Test run failed: Instrumentation run failed due to 'Process crashed.',很奇怪。有哪位可以帮我看看为什么?看了网上一些回答,好像和我的原因有一些不一样

Xml:
<?xml version="1.0" encoding="utf-8"?>
package="com.XXX.XXX.test"
android:versionCode="1"
android:versionName="1.0" >



android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.XXX.XXXX" />

android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >

Console Log:
[2015-04-23 11:16:43 - test01] ------------------------------
[2015-04-23 11:16:43 - test01] Android Launch!
[2015-04-23 11:16:43 - test01] adb is running normally.
[2015-04-23 11:16:43 - test01] Performing android.test.InstrumentationTestRunner JUnit launch
[2015-04-23 11:16:43 - test01] Automatic Target Mode: using device '0123456789ABCDEF'
[2015-04-23 11:16:43 - test01] Uploading test01.apk onto device '0123456789ABCDEF'
[2015-04-23 11:16:44 - test01] Installing test01.apk...
[2015-04-23 11:16:49 - test01] Success!
[2015-04-23 11:16:49 - test01] Launching instrumentation android.test.InstrumentationTestRunner on 0123456789ABCDEF
[2015-04-23 11:16:50 - test01] Sending test information to Eclipse
[2015-04-23 11:16:55 - test01] Test run failed: Instrumentation run failed due to 'Process crashed.'
[2015-04-23 11:16:55 - test01] Test run finished

Logcat Log:
04-23 11:16:50.772: D/wpa_supplicant(1043): RX ctrl_iface - hexdump(len=11): 53 49 47 4e 41 4c 5f 50 4f 4c 4c
04-23 11:16:50.772: D/wpa_supplicant(1043): wlan0: Control interface command 'SIGNAL_POLL'
04-23 11:16:50.772: D/wpa_supplicant(1043): nl80211: survey data missing!
04-23 11:16:51.142: D/StatusBar.SimNetworkController(962): refreshViews subscription =0mMSimDataConnected =false
04-23 11:16:51.152: D/StatusBar.SimNetworkController(962): refreshViews mMSimDataActivity =0
04-23 11:16:51.152: D/StatusBar.SimNetworkController(962): refreshViews connected={ wifi } level=0 mMSimcombinedSignalIconId=0x7f0202cb/com.android.systemui:drawable/stat_sys_wifi_signal_3 mMSimcombinedActivityIconId=0x7f0202c4 mAirplaneMode=false mMSimDataActivity=0 mMSimPhoneSignalIconId=0x7f0202b7 mMSimDataDirectionIconId=0x0 mMSimDataSignalIconId=0x7f0202b7 mMSimDataTypeIconId=0x0 mNoMSimIconId=0x7f02016b mWifiIconId=0x7f0202cb mBluetoothTetherIconId=0x108067f
04-23 11:16:51.152: I/CTSimSignalCluster(962): setMobileDataIndicators subscription=0dataConnect=false, dataTypeState=0
04-23 11:16:51.152: I/CTSimSignalCluster(962): voice radio technology is0, isGSM = false isRoaming = false
04-23 11:16:51.152: I/CTSimSignalCluster(962): voice radio technology is0, isGSM = false isRoaming = false
04-23 11:16:51.152: I/CTSimSignalCluster(962): setMobileDataIndicators mMobileStrengthId[0]=2130838200 mMobileStrengthId[1]=2130838200
04-23 11:16:51.152: D/CTSimSignalCluster(962): getAcitivyTypeIconId type=2 inout=0 subscription0
04-23 11:16:51.152: I/CTSimSignalCluster(962): SetMobileDataIndicators MNoSimIconVisible 0=true
04-23 11:16:51.152: D/CTSimSignalCluster(962): wifi: VISIBLE sig=2130838219 act=2130838212
04-23 11:16:51.162: D/CTSimSignalCluster(962): wifi: VISIBLE sig=2130838219 act=2130838212
04-23 11:16:51.162: D/CTSimSignalCluster(962): wifi: VISIBLE sig=2130838219 act=2130838212
04-23 11:16:51.162: D/StatusBar.SimNetworkController(962): changing data overlay icon id to 2130838212
04-23 11:16:51.432: E/BatteryService(867): update ChargerNames.size = 1
04-23 11:16:51.432: E/BatteryService(867): update ChargerNames[0] = usb
04-23 11:16:51.432: D/BatteryService(867): Processing new values: mAcOnline=false, mUsbOnline=true, mWirelessOnline=false, mBatteryStatus=2, mBatteryHealth=2, mBatteryPresent=true, mBatteryLevel=92, mBatteryTechnology=Li-ion, mBatteryVoltage=4243, mBatteryTemperature=303, mBatteryLevelCritical=false, mPlugType=2
04-23 11:16:51.432: D/BatteryService(867): Sending ACTION_BATTERY_CHANGED. level:92, scale:100, status:2, health:2, present:true, voltage: 4243, temperature: 303, technology: Li-ion, AC powered:false, USB powered:true, Wireless powered:false, icon:17303117, invalid charger:0
04-23 11:16:51.442: D/PowerManagerService(867): BatteryReceiver:handleBatteryStateChangedLocked
04-23 11:16:51.452: D/PowerUI(962): buckets .....20 .. 15 .. 10
04-23 11:16:51.452: D/PowerUI(962): level 92 --> 92
04-23 11:16:51.452: D/PowerUI(962): status 2 --> 2
04-23 11:16:51.452: D/PowerUI(962): plugType 2 --> 2
04-23 11:16:51.452: D/PowerUI(962): invalidCharger 0 --> 0
04-23 11:16:51.452: D/PowerUI(962): bucket 1 --> 1
04-23 11:16:51.452: D/PowerUI(962): plugged true --> true
04-23 11:16:51.462: D/PowerUI(962): health 2 --> 2
04-23 11:16:51.462: D/PowerUI(962): mBatteryTemperature .. 303
04-23 11:16:51.462: D/PowerManagerService(867): updateIsPoweredLocked: wasPowered=true, mIsPowered=true, oldPlugType=2, mPlugType=2, mBatteryLevel=92
04-23 11:16:51.462: D/PowerManagerService(867): handleSandman: canDream=true, mWakefulness=Awake
04-23 11:16:51.462: D/PowerUI(962): mIsBatteryTempShowDialog .. true
04-23 11:16:51.472: D/BootCompleteReceiverService(25634): powerModeReceiverBoardcast action = android.intent.action.BATTERY_CHANGED
04-23 11:16:51.472: D/BootCompleteReceiverService(25634): mBatteryLevel=92
04-23 11:16:51.482: D/BootCompleteReceiverService(25634): powerLevel=15|enable = false|enable = 2
04-23 11:16:51.482: D/BootCompleteReceiverService(25634): mBatteryStatus=2
04-23 11:16:51.512: E/BatteryService(867): update ChargerNames.size = 1
04-23 11:16:51.512: E/BatteryService(867): update ChargerNames[0] = usb
04-23 11:16:51.512: D/BatteryService(867): Processing new values: mAcOnline=false, mUsbOnline=true, mWirelessOnline=false, mBatteryStatus=2, mBatteryHealth=2, mBatteryPresent=true, mBatteryLevel=92, mBatteryTechnology=Li-ion, mBatteryVoltage=4241, mBatteryTemperature=304, mBatteryLevelCritical=false, mPlugType=2
04-23 11:16:51.512: D/BatteryService(867): Sending ACTION_BATTERY_CHANGED. level:92, scale:100, status:2, health:2, present:true, voltage: 4241, temperature: 304, technology: Li-ion, AC powered:false, USB powered:true, Wireless powered:false, icon:17303117, invalid charger:0
04-23 11:16:51.522: D/PowerManagerService(867): BatteryReceiver:handleBatteryStateChangedLocked
04-23 11:16:51.522: D/PowerUI(962): buckets .....20 .. 15 .. 10
04-23 11:16:51.522: D/PowerUI(962): level 92 --> 92
04-23 11:16:51.522: D/PowerUI(962): status 2 --> 2
04-23 11:16:51.522: D/PowerUI(962): plugType 2 --> 2
04-23 11:16:51.522: D/PowerUI(962): invalidCharger 0 --> 0
04-23 11:16:51.522: D/PowerUI(962): bucket 1 --> 1
04-23 11:16:51.522: D/PowerUI(962): plugged true --> true
04-23 11:16:51.522: D/PowerUI(962): health 2 --> 2
04-23 11:16:51.522: D/PowerUI(962): mBatteryTemperature .. 304
04-23 11:16:51.522: D/PowerUI(962): mIsBatteryTempShowDialog .. true
04-23 11:16:51.522: D/PowerManagerService(867): updateIsPoweredLocked: wasPowered=true, mIsPowered=true, oldPlugType=2, mPlugType=2, mBatteryLevel=92
04-23 11:16:51.522: D/PowerManagerService(867): handleSandman: canDream=true, mWakefulness=Awake
04-23 11:16:51.532: D/BootCompleteReceiverService(25634): powerModeReceiverBoardcast action = android.intent.action.BATTERY_CHANGED
04-23 11:16:51.532: D/BootCompleteReceiverService(25634): mBatteryLevel=92
04-23 11:16:51.532: D/BootCompleteReceiverService(25634): powerLevel=15|enable = false|enable = 2
04-23 11:16:51.532: D/BootCompleteReceiverService(25634): mBatteryStatus=2
04-23 11:16:51.532: D/dalvikvm(25634): GC_CONCURRENT freed 371K, 19% free 2628K/3224K, paused 8ms+1ms, total 60ms
04-23 11:16:52.162: D/StatusBar.SimNetworkController(962): refreshViews subscription =0mMSimDataConnected =false
04-23 11:16:52.162: D/StatusBar.SimNetworkController(962): refreshViews mMSimDataActivity =0
04-23 11:16:52.162: D/StatusBar.SimNetworkController(962): refreshViews connected={ wifi } level=0 mMSimcombinedSignalIconId=0x7f0202cb/com.android.systemui:drawable/stat_sys_wifi_signal_3 mMSimcombinedActivityIconId=0x7f0202c5 mAirplaneMode=false mMSimDataActivity=0 mMSimPhoneSignalIconId=0x7f0202b7 mMSimDataDirectionIconId=0x0 mMSimDataSignalIconId=0x7f0202b7 mMSimDataTypeIconId=0x0 mNoMSimIconId=0x7f02016b mWifiIconId=0x7f0202cb mBluetoothTetherIconId=0x108067f
04-23 11:16:52.172: I/CTSimSignalCluster(962): setMobileDataIndicators subscription=0dataConnect=false, dataTypeState=0
04-23 11:16:52.172: I/CTSimSignalCluster(962): voice radio technology is0, isGSM = false isRoaming = false
04-23 11:16:52.172: I/CTSimSignalCluster(962): voice radio technology is0, isGSM = false isRoaming = false
04-23 11:16:52.172: I/CTSimSignalCluster(962): setMobileDataIndicators mMobileStrengthId[0]=2130838200 mMobileStrengthId[1]=2130838200
04-23 11:16:52.172: D/CTSimSignalCluster(962): getAcitivyTypeIconId type=2 inout=0 subscription0
04-23 11:16:52.172: I/CTSimSignalCluster(962): SetMobileDataIndicators MNoSimIconVisible 0=true
04-23 11:16:52.172: D/CTSimSignalCluster(962): wifi: VISIBLE sig=2130838219 act=2130838213
04-23 11:16:52.172: D/CTSimSignalCluster(962): wifi: VISIBLE sig=2130838219 act=2130838213
04-23 11:16:52.172: D/CTSimSignalCluster(962): wifi: VISIBLE sig=2130838219 act=2130838213
04-23 11:16:52.182: D/StatusBar.SimNetworkController(962): changing data overlay icon id to 2130838213
04-23 11:16:53.172: D/StatusBar.SimNetworkController(962): refreshViews subscription =0mMSimDataConnected =false
04-23 11:16:53.172: D/StatusBar.SimNetworkController(962): refreshViews mMSimDataActivity =0
04-23 11:16:53.172: D/StatusBar.SimNetworkController(962): refreshViews connected={ wifi } level=0 mMSimcombinedSignalIconId=0x7f0202cb/com.android.systemui:drawable/stat_sys_wifi_signal_3 mMSimcombinedActivityIconId=0x7f0202c4 mAirplaneMode=false mMSimDataActivity=0 mMSimPhoneSignalIconId=0x7f0202b7 mMSimDataDirectionIconId=0x0 mMSimDataSignalIconId=0x7f0202b7 mMSimDataTypeIconId=0x0 mNoMSimIconId=0x7f02016b mWifiIconId=0x7f0202cb mBluetoothTetherIconId=0x108067f
04-23 11:16:53.172: I/CTSimSignalCluster(962): setMobileDataIndicators subscription=0dataConnect=false, dataTypeState=0
04-23 11:16:53.172: I/CTSimSignalCluster(962): voice radio technology is0, isGSM = false isRoaming = false
04-23 11:16:53.172: I/CTSimSignalCluster(962): voice radio technology is0, isGSM = false isRoaming = false
04-23 11:16:53.172: I/CTSimSignalCluster(962): setMobileDataIndicators mMobileStrengthId[0]=2130838200 mMobileStrengthId[1]=2130838200
04-23 11:16:53.172: D/CTSimSignalCluster(962): getAcitivyTypeIconId type=2 inout=0 subscription0
04-23 11:16:53.172: I/CTSimSignalCluster(962): SetMobileDataIndicators MNoSimIconVisible 0=true
04-23 11:16:53.172: D/CTSimSignalCluster(962): wifi: VISIBLE sig=2130838219 act=2130838212
04-23 11:16:53.172: D/CTSimSignalCluster(962): wifi: VISIBLE sig=2130838219 act=2130838212
04-23 11:16:53.172: D/CTSimSignalCluster(962): wifi: VISIBLE sig=2130838219 act=2130838212
04-23 11:16:53.172: D/StatusBar.SimNetworkController(962): changing data overlay icon id to 2130838212
04-23 11:16:53.632: E/QCALOG(351): [MessageQ] ProcessNewMessage: [XT-CS] unknown deliver target [OS-Agent]
04-23 11:16:53.752: E/QCALOG(351): [MessageQ] ProcessNewMessage: [XTWiFi-PE] unknown deliver target [OS-Agent]
04-23 11:16:53.782: D/wpa_supplicant(1043): RX ctrl_iface - hexdump(len=11): 53 49 47 4e 41 4c 5f 50 4f 4c 4c
04-23 11:16:53.782: D/wpa_supplicant(1043): wlan0: Control interface command 'SIGNAL_POLL'
04-23 11:16:53.792: D/wpa_supplicant(1043): nl80211: survey data missing!
04-23 11:16:53.822: V/DeviceStorageMonitorService(867): freeMemory=325029888
04-23 11:16:53.822: I/DeviceStorageMonitorService(867): Posting Message again
04-23 11:16:54.182: D/StatusBar.SimNetworkController(962): refreshViews subscription =0mMSimDataConnected =false
04-23 11:16:54.182: D/StatusBar.SimNetworkController(962): refreshViews mMSimDataActivity =0
04-23 11:16:54.182: D/StatusBar.SimNetworkController(962): refreshViews connected={ wifi } level=0 mMSimcombinedSignalIconId=0x7f0202cb/com.android.systemui:drawable/stat_sys_wifi_signal_3 mMSimcombinedActivityIconId=0x0 mAirplaneMode=false mMSimDataActivity=0 mMSimPhoneSignalIconId=0x7f0202b7 mMSimDataDirectionIconId=0x0 mMSimDataSignalIconId=0x7f0202b7 mMSimDataTypeIconId=0x0 mNoMSimIconId=0x7f02016b mWifiIconId=0x7f0202cb mBluetoothTetherIconId=0x108067f
04-23 11:16:54.182: I/CTSimSignalCluster(962): setMobileDataIndicators subscription=0dataConnect=false, dataTypeState=0
04-23 11:16:54.182: I/CTSimSignalCluster(962): voice radio technology is0, isGSM = false isRoaming = false
04-23 11:16:54.182: I/CTSimSignalCluster(962): voice radio technology is0, isGSM = false isRoaming = false
04-23 11:16:54.182: D/CTSimSignalCluster(962): wifi: VISIBLE sig=2130838219 act=0
04-23 11:16:54.192: I/CTSimSignalCluster(962): setMobileDataIndicators mMobileStrengthId[0]=2130838200 mMobileStrengthId[1]=2130838200
04-23 11:16:54.192: D/CTSimSignalCluster(962): getAcitivyTypeIconId type=2 inout=0 subscription0
04-23 11:16:54.192: I/CTSimSignalCluster(962): SetMobileDataIndicators MNoSimIconVisible 0=true
04-23 11:16:54.192: D/RamMonitorService(867): checkMemory(464 MB)
04-23 11:16:54.192: D/CTSimSignalCluster(962): wifi: VISIBLE sig=2130838219 act=0
04-23 11:16:54.192: D/CTSimSignalCluster(962): wifi: VISIBLE sig=2130838219 act=0
04-23 11:16:54.202: D/StatusBar.SimNetworkController(962): changing data overlay icon id to 0
04-23 11:16:54.782: E/BatteryService(867): update ChargerNames.size = 1
04-23 11:16:54.782: E/BatteryService(867): update ChargerNames[0] = usb
04-23 11:16:54.792: D/BatteryService(867): Processing new values: mAcOnline=false, mUsbOnline=true, mWirelessOnline=false, mBatteryStatus=2, mBatteryHealth=2, mBatteryPresent=true, mBatteryLevel=93, mBatteryTechnology=Li-ion, mBatteryVoltage=4243, mBatteryTemperature=303, mBatteryLevelCritical=false, mPlugType=2
04-23 11:16:54.792: D/BatteryService(867): Sending ACTION_BATTERY_CHANGED. level:93, scale:100, status:2, health:2, present:true, voltage: 4243, temperature: 303, technology: Li-ion, AC powered:false, USB powered:true, Wireless powered:false, icon:17303117, invalid charger:0
04-23 11:16:54.802: D/PowerManagerService(867): BatteryReceiver:handleBatteryStateChangedLocked
04-23 11:16:54.812: D/PowerUI(962): buckets .....20 .. 15 .. 10
04-23 11:16:54.812: D/PowerUI(962): level 92 --> 93
04-23 11:16:54.812: D/PowerUI(962): status 2 --> 2
04-23 11:16:54.812: D/PowerUI(962): plugType 2 --> 2
04-23 11:16:54.822: D/PowerUI(962): invalidCharger 0 --> 0
04-23 11:16:54.822: D/PowerManagerService(867): updateIsPoweredLocked: wasPowered=true, mIsPowered=true, oldPlugType=2, mPlugType=2, mBatteryLevel=93
04-23 11:16:54.822: D/PowerManagerService(867): handleSandman: canDream=true, mWakefulness=Awake
04-23 11:16:54.822: D/PowerUI(962): bucket 1 --> 1
04-23 11:16:54.822: D/PowerUI(962): plugged true --> true
04-23 11:16:54.822: D/PowerUI(962): health 2 --> 2
04-23 11:16:54.822: D/PowerUI(962): mBatteryTemperature .. 303
04-23 11:16:54.822: D/PowerUI(962): mIsBatteryTempShowDialog .. true
04-23 11:16:54.832: D/BootCompleteReceiverService(25634): powerModeReceiverBoardcast action = android.intent.action.BATTERY_CHANGED
04-23 11:16:54.832: D/BootCompleteReceiverService(25634): mBatteryLevel=93
04-23 11:16:54.832: D/BootCompleteReceiverService(25634): powerLevel=15|enable = false|enable = 2
04-23 11:16:54.832: D/BootCompleteReceiverService(25634): mBatteryStatus=2
04-23 11:16:54.862: E/BatteryService(867): update ChargerNames.size = 1
04-23 11:16:54.862: E/BatteryService(867): update ChargerNames[0] = usb
04-23 11:16:54.862: D/BatteryService(867): Processing new values: mAcOnline=false, mUsbOnline=true, mWirelessOnline=false, mBatteryStatus=2, mBatteryHealth=2, mBatteryPresent=true, mBatteryLevel=93, mBatteryTechnology=Li-ion, mBatteryVoltage=4236, mBatteryTemperature=304, mBatteryLevelCritical=false, mPlugType=2
04-23 11:16:54.862: D/BatteryService(867): Sending ACTION_BATTERY_CHANGED. level:93, scale:100, status:2, health:2, present:true, voltage: 4236, temperature: 304, technology: Li-ion, AC powered:false, USB powered:true, Wireless powered:false, icon:17303117, invalid charger:0
04-23 11:16:54.872: D/BootCompleteReceiverService(25634): powerModeReceiverBoardcast action = android.intent.action.BATTERY_CHANGED
04-23 11:16:54.872: D/BootCompleteReceiverService(25634): mBatteryLevel=93
04-23 11:16:54.872: D/BootCompleteReceiverService(25634): powerLevel=15|enable = false|enable = 2
04-23 11:16:54.872: D/BootCompleteReceiverService(25634): mBatteryStatus=2
04-23 11:16:54.872: D/PowerManagerService(867): BatteryReceiver:handleBatteryStateChangedLocked
04-23 11:16:54.872: D/PowerUI(962): buckets .....20 .. 15 .. 10
04-23 11:16:54.872: D/PowerUI(962): level 93 --> 93
04-23 11:16:54.872: D/PowerUI(962): status 2 --> 2
04-23 11:16:54.872: D/PowerUI(962): plugType 2 --> 2
04-23 11:16:54.872: D/PowerUI(962): invalidCharger 0 --> 0
04-23 11:16:54.872: D/PowerUI(962): bucket 1 --> 1
04-23 11:16:54.872: D/PowerUI(962): plugged true --> true
04-23 11:16:54.872: D/PowerUI(962): health 2 --> 2
04-23 11:16:54.872: D/PowerUI(962): mBatteryTemperature .. 304
04-23 11:16:54.872: D/PowerUI(962): mIsBatteryTempShowDialog .. true
04-23 11:16:54.872: D/PowerManagerService(867): updateIsPoweredLocked: wasPowered=true, mIsPowered=true, oldPlugType=2, mPlugType=2, mBatteryLevel=93
04-23 11:16:54.872: D/PowerManagerService(867): handleSandman: canDream=true, mWakefulness=Awake
04-23 11:16:56.802: D/wpa_supplicant(1043): RX ctrl_iface - hexdump(len=11): 53 49 47 4e 41 4c 5f 50 4f 4c 4c
04-23 11:16:56.802: D/wpa_supplicant(1043): wlan0: Control interface command 'SIGNAL_POLL'
04-23 11:16:56.812: D/wpa_supplicant(1043): nl80211: survey data missing!
04-23 11:16:58.632: E/QCALOG(351): [MessageQ] ProcessNewMessage: [XT-CS] unknown deliver target [OS-Agent]
04-23 11:16:58.752: E/QCALOG(351): [MessageQ] ProcessNewMessage: [XTWiFi-PE] unknown deliver target [OS-Agent]
04-23 11:16:59.822: D/wpa_supplicant(1043): RX ctrl_iface - hexdump(len=11): 53 49 47 4e 41 4c 5f 50 4f 4c 4c
04-23 11:16:59.822: D/wpa_supplicant(1043): wlan0: Control interface command 'SIGNAL_POLL'
04-23 11:16:59.832: D/wpa_supplicant(1043): nl80211: survey data missing!

共收到 5 条回复 时间 点赞

用真机试下~

#1 楼 @jessica 我用的就是真机,联想 A780e 已 root

可能是在 tearDown 中写了 solo.finishOpenedActivities();的原因

#3 楼 @emily 我有时候是一运行就出现这个 fail,有时候运行了一半出现的,一般应该还没跑到 tearDown;如果是这个原因的话,请问一下你在 tearDown 里怎么写的呢?不用关闭 activities 么?

#4 楼 @azdbaaaaaa 你可以试一下先把 finishOpenedActivities 去掉,看是不是这个原因,如果是,再补回来,在测试 testcase 中使用 Thead.sleep(10000) 让线程休息一下,看是否还会报错

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册