Poco
Poco copied to clipboard
Constant rpctimeout errors after upgrading to Unity 2019
Describe the bug "RpcTimeoutError" and "socket connection broken" were errors that happened from time to time but since it was very occasionally, I didn't search for a fix. However, after upgrading my project to Unity 2019, these became a lot more frequent to the point where I am unable to run a 10min test without it breaking due to a "RpcTimeoutError."
Example below:
======================================================================
ERROR: runTest (airtest.cli.runner.AirtestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/airtest/cli/runner.py", line 69, in runTest
six.reraise(*sys.exc_info())
File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/dist-packages/airtest/cli/runner.py", line 65, in runTest
exec(compile(code.encode("utf-8"), pyfilepath, 'exec'), self.scope)
File "/project/Airtest/Tutorial.air/Tutorial.py", line 115, in <module>
OverlayExit(build='Voice Chat') # Unlock voice chat
File "/project/Airtest/functions.air/functions.py", line 698, in OverlayExit
while not poco('ChestButton').exists():
File "/usr/local/lib/python3.6/dist-packages/poco/proxy.py", line 72, in wrapped
return func(proxy, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/poco/proxy.py", line 774, in exists
return self.attr('visible')
File "/usr/local/lib/python3.6/dist-packages/poco/proxy.py", line 39, in wrapped
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/poco/proxy.py", line 734, in attr
nodes = self._do_query(multiple=False)
File "/usr/local/lib/python3.6/dist-packages/poco/proxy.py", line 872, in _do_query
self._nodes = self.poco.agent.hierarchy.select(self.query, multiple)
File "/usr/local/lib/python3.6/dist-packages/poco/freezeui/hierarchy.py", line 90, in select
return self.selector.select(query, multiple)
File "/usr/local/lib/python3.6/dist-packages/poco/sdk/Selector.py", line 78, in select
return self.selectImpl(cond, multiple, self.getRoot(), 9999, True, True)
File "/usr/local/lib/python3.6/dist-packages/poco/sdk/Selector.py", line 71, in getRoot
return self.dumper.getRoot()
File "/usr/local/lib/python3.6/dist-packages/poco/freezeui/hierarchy.py", line 35, in getRoot
root = Node(self.dumpHierarchy())
File "/usr/local/lib/python3.6/dist-packages/poco/utils/simplerpc/utils.py", line 13, in new_func
ret, err = cb.wait(timeout=30)
File "/usr/local/lib/python3.6/dist-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 0x7fab65764fd0> (rid=dce49a28-de7e-478a-81e0-3aad3fca14be) (connection="tcp://172.17.0.1:13510")
----------------------------------------------------------------------
Ran 1 test in 589.428s
FAILED (errors=1)
python version: python2.7.15
(but I tried with different ones)
poco version: 1.0.76
Smartphone:
- Device: pocophone f1, motog6 plus, oneplus6
- OS: Android 9, Android 8, Android 9
Additional context I reckon these connectivity issues might have been introduced by the new Unity but I still took the liberty to submit an issue here in hopes that someone has insight about this kind of errors. Overall, Airtest and the poco integration work really well, you guys did a great job -- it's only these connectivity issues that are disabling me to use your software in its full capacity.
hi @fabioramos8
what's the log in logcat when the RpcTimeoutError
occurs?
unfortunately, there are no relevant logs on logcat regardless of the filtering that I set -- the script simply dies silently
ret, err = cb.wait(timeout=30)
It seems that the issue is that if the hierarchy is not visible in 30 seconds, it raises the exception of Rcptimeouterror
method can be found in "/usr/local/lib/python3.6/dist-packages/poco/utils/simplerpc/utils.py"
This can be a common issue if you have huge hierarchy node that takes very long time to refresh/appear, or at the beginning of the application when trying to load it first time, which might be because you are trying to use poco too soon