question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

描述问题bug 几台设备(OPPO R2017/R6007/A31/R3, VIVO Y51A)在测试过程中都遇到RpcTimeoutError报错 1.同一个app下,UI少的界面没问题,UI稍多的界面就会报错 2.同一个UI稍多的界面,用AirtestIDE或者直接poco脚本(简单一句dump)都会报错,用PocoHierarchyViewer怎样刷新都没问题

PS: 把打印打开,看到是socket recv timeout,是safetcp那块有问题? PS2: 单独打了一个Demo包,已发客服大锅,用VIVO Y51A(文档上看到兼容设备列表有)应该能复现的,看到,主界面dump就会报错,打开第一个Graph界面就不会报错

报错信息

======================================================================
ERROR: runTest (app.widgets.code_runner.ide_launcher.AirtestIDECase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "airtest\cli\runner.py", line 66, in runTest
  File "site-packages\six.py", line 693, in reraise
  File "airtest\cli\runner.py", line 62, in runTest
  File "C:\Users\Administrator\AppData\Local\Temp\AirtestIDE\Scripts\untitled.air\untitled.py", line 4, in <module>
    print(poco.agent.hierarchy.dump())
  File "poco\freezeui\hierarchy.py", line 68, in dump
  File "poco\utils\simplerpc\utils.py", line 13, in new_func
  File "poco\utils\simplerpc\simplerpc.py", line 78, in wait
poco.utils.simplerpc.simplerpc.RpcTimeoutError: <poco.utils.simplerpc.simplerpc.Callback object at 0x000000000D8689E8>(rid=548523b2-54d3-4f8d-bbbf-28aaed86418e)

分别是PS2中两个界面打印的日志

====[POCO] HandleTcpClientAccepted 1
====[POCO] HandleTcpClientAccepted 2
====[POCO] HandleTcpClientAccepted 3
====[POCO] TCP client 127.0.0.1:43482 has connected.
====[POCO] ContinueReadBuffer
====[POCO] HandleDatagramReceived 1
====[POCO] HandleDatagramReceived 2
====[POCO] HandleTcpClientAccepted 4
====[POCO] HandleDatagramReceived numberOfReadBytes 104
====[POCO] HandleDatagramReceived 4
====[POCO] Client : 127.0.0.1:43482 --> 104
====[POCO] ContinueReadBuffer
====[POCO] Update  msgs.Count = 1
====[POCO] Update msg = {"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "76cf54a8-cd37-4ecb-baa3-89e10d5bfa4a"}
====[POCO] Update response = {"jsonrpc":"2.0","id":"76cf54a8-cd37-4ecb-baa3-89e10d5bfa4a","result":{"name":"<Root>","payload":{"name":"<Root>","type":"Root","visible":true,"pos":[0.0,0.0],"size":[0.0,0.0],"scale":[1.0,1.0],"anchorPoint":[0.5,0.5],"zOrders":{"local":0,"global":0}},"children":[{"name":"[FairyGUI.Timers]","payload":{"name":"[FairyGUI.Timers]","type":"GameObject","visible":true,"pos":[0.0,0.0],"size":[0.0,0.0],"scale":[1.0,1.0],"anchorPoint":[0.0,0.0],"zOrders":{"local":0,"global":0},"clickable":false,"components":["Transform","TimersEngine"],"_ilayer":0,"layer":"Default","_instanceId":-86}},{"name":"Stage","payload":{"name":"Stage","type":"Stage","visible":true,"pos":[0.0,0.0],"size":[0.0,0.0],"scale":[1.0,1.0],"anchorPoint":[0.0,0.0],"zOrders":{"local":0,"global":0},"clickable":false,"components":["Transform","DisplayObjectInfo","StageEngine","UIContentScaler","AudioSource"],"_ilayer":5,"layer":"UI","_instanceId":-72},"children":[{"name":"GRoot","payload":{"name":"GRoot","type":"Root","visible
====[POCO] Update send
====[POCO] Tcp Send datagram.Length = 32926
====[POCO] HandleDatagramReceived 1
====[POCO] HandleDatagramReceived 2
====[POCO] HandleDatagramReceived numberOfReadBytes 0
====[POCO] TCP client 127.0.0.1:43482 has disconnected.
====[POCO] HandleDatagramReceived 3
====[POCO] HandleTcpClientAccepted 1
====[POCO] HandleTcpClientAccepted 2
====[POCO] HandleTcpClientAccepted 3
====[POCO] TCP client 127.0.0.1:43483 has connected.
====[POCO] ContinueReadBuffer
====[POCO] HandleTcpClientAccepted 4
====[POCO] HandleDatagramReceived 1
====[POCO] HandleDatagramReceived 2
====[POCO] HandleDatagramReceived numberOfReadBytes 104
====[POCO] HandleDatagramReceived 4
====[POCO] Client : 127.0.0.1:43483 --> 104
====[POCO] ContinueReadBuffer
====[POCO] Update  msgs.Count = 1
====[POCO] Update msg = {"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "23ca68e0-bfb1-4b39-9706-e797c9842661"}
====[POCO] Update response = {"jsonrpc":"2.0","id":"23ca68e0-bfb1-4b39-9706-e797c9842661","result":{"name":"<Root>","payload":{"name":"<Root>","type":"Root","visible":true,"pos":[0.0,0.0],"size":[0.0,0.0],"scale":[1.0,1.0],"anchorPoint":[0.5,0.5],"zOrders":{"local":0,"global":0}},"children":[{"name":"[FairyGUI.TweenManager]","payload":{"name":"[FairyGUI.TweenManager]","type":"GameObject","visible":true,"pos":[0.0,0.0],"size":[0.0,0.0],"scale":[1.0,1.0],"anchorPoint":[0.0,0.0],"zOrders":{"local":0,"global":0},"clickable":false,"components":["Transform","TweenEngine"],"_ilayer":0,"layer":"Default","_instanceId":-1544}},{"name":"[FairyGUI.Timers]","payload":{"name":"[FairyGUI.Timers]","type":"GameObject","visible":true,"pos":[0.0,0.0],"size":[0.0,0.0],"scale":[1.0,1.0],"anchorPoint":[0.0,0.0],"zOrders":{"local":0,"global":0},"clickable":false,"components":["Transform","TimersEngine"],"_ilayer":0,"layer":"Default","_instanceId":-86}},{"name":"Stage","payload":{"name":"Stage","type":"Stage","visible":true,"pos":[
====[POCO] Update send
====[POCO] Tcp Send datagram.Length = 9432
====[POCO] HandleDatagramReceived 1
====[POCO] HandleDatagramReceived 2
====[POCO] HandleDatagramReceived numberOfReadBytes 0
====[POCO] TCP client 127.0.0.1:43483 has disconnected.
====[POCO] HandleDatagramReceived 3

复现代码

# -*- encoding=utf8 -*-
from poco.drivers.unity3d import UnityPoco
poco = UnityPoco()
print(poco.agent.hierarchy.dump())

python 版本: python3.6.5

poco 版本: 1.0.70 AirtestIDE版本: v1.1.0

设备:

  • 型号: OPPO R2017/R6007/A31/R3, VIVO Y51A

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lazydaocommented, Nov 10, 2020

poco.utils.simplerpc.simplerpc.RpcTimeoutError感觉是个顽疾,,,也不知道有没有优化的一天,,,

1reaction
saint228commented, Apr 1, 2019

今天我在使用mumu模拟器跑测试时,也频繁碰到这个。我的测试内容是:“打开游戏”->"登录“->做加好友的操作”->“关闭游戏” `如此循环。打开/关闭游戏瞬间的数据量会比较大。 log如下:

`ERROR: runTest (main.CustomCase)

Traceback (most recent call last): File “D:\Python3.7\lib\site-packages\airtest\cli\runner.py”, line 66, in runTest six.reraise(*sys.exc_info()) File “D:\Python3.7\lib\site-packages\six.py”, line 693, in reraise raise value File “D:\Python3.7\lib\site-packages\airtest\cli\runner.py”, line 62, in runTest exec(compile(code.encode(“utf-8”), pyfilepath, ‘exec’), self.scope) File “E:\TestSVN\QA\RO3D\airtest\AddFriends.air\AddFriends.py”, line 74, in <module> Login(i) File “E:\TestSVN\QA\RO3D\airtest\AddFriends.air\AddFriends.py”, line 35, in Login poco(“ButtonNextStep”).click() File “D:\Python3.7\lib\site-packages\poco\proxy.py”, line 23, in wrapped return func(proxy, *args, **kwargs) File “D:\Python3.7\lib\site-packages\poco\proxy.py”, line 283, in click pos_in_percentage = self.get_position(focus) File “D:\Python3.7\lib\site-packages\poco\proxy.py”, line 563, in get_position pos = self.attr(‘pos’) File “D:\Python3.7\lib\site-packages\poco\proxy.py”, line 39, in wrapped return func(self, *args, **kwargs) File “D:\Python3.7\lib\site-packages\poco\proxy.py”, line 684, in attr nodes = self._do_query(multiple=False) File “D:\Python3.7\lib\site-packages\poco\proxy.py”, line 819, in _do_query self._nodes = self.poco.agent.hierarchy.select(self.query, multiple) File “D:\Python3.7\lib\site-packages\poco\freezeui\hierarchy.py”, line 89, in select return self.selector.select(query, multiple) File “D:\Python3.7\lib\site-packages\poco\sdk\Selector.py”, line 77, in select return self.selectImpl(cond, multiple, self.getRoot(), 9999, True, True) File “D:\Python3.7\lib\site-packages\poco\sdk\Selector.py”, line 70, in getRoot return self.dumper.getRoot() File “D:\Python3.7\lib\site-packages\poco\freezeui\hierarchy.py”, line 35, in getRoot root = Node(self.dumpHierarchy()) File “D:\Python3.7\lib\site-packages\poco\utils\simplerpc\utils.py”, line 13, in new_func ret, err = cb.wait(timeout=30) File “D:\Python3.7\lib\site-packages\poco\utils\simplerpc\simplerpc.py”, line 78, in wait raise RpcTimeoutError(self) poco.utils.simplerpc.simplerpc.RpcTimeoutError: <poco.utils.simplerpc.simplerpc.Callback object at 0x00A76D70>(rid=4d014a7c-7721-45b4-bd40-7b071e6b33d1)`

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Junos PyEZ Errors When Configuring Junos ...
The Junos PyEZ code generates an RpcTimeoutError message or a TimeoutExpiredError message and fails to update the device configuration.
Read more >
RpcTimeoutError(10.1.1.1,request-snapshot,30)
I'm trying to execute a "request system snapshot media internal slice alternate" via RPC. >>> from pprint import pprint as pp. >>> dev ......
Read more >
ansible - I'm having RpcTimeoutError commit-configuration
I am using juniper module for Ansible, however I'm having the issue below. Do you have any idea ? fatal: [172.31.30.158]: FAILED! =>...
Read more >
Config.diff() does not handle RpcTimeoutError properly #830
If a timeout happens when calling .pdiff() on a config table instance, the RpcTimeoutError is caught (as an RpcError) at ...
Read more >
jnpr.junos.device - Junos PyEZ's documentation!
RpcTimeoutError (dev, cmd, timeout)[source]¶. Bases: jnpr.junos.exception.RpcError. Generated in response to a RPC execution timeout. __init__ (dev, cmd, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found