AirtestProject / AirtestProject/Poco

Socket connection error

Đang mở
#476 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
2k
Fork
341
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### **Specs:**

- Device: iPad mini 2.
- iOS: 12.5.4
- Poco version: 1.0.82 (Not sure)
- Using Poco with Cocos-lua

### **Description:**

An exception of Socket connection error or Connection reset by peer is raised when trying to use any node's method (click(), exists(), etc) if the app is started from Airtest IDE with the instruction start_app(appName). If the app is started before (directly from the device or in XCode) and the python script is executed, everything works properly.

### **Expected behavior:**
Everything should work the same way. It should not matter where the app is started from.
Remove any following parts if does not have details about

### **Python Code: **
`__author__ = "victor.velez"

import time
from airtest.core.api import *
from poco.drivers.std import StdPoco

auto_setup(__file__)
poco = StdPoco()

appLang = "spa" #eng
appName = "com.appOne.victorapp" #Fake Name of app in iOS

start_app(appName)

sleep(100)

btn = poco("game_layer").child("scene").offspring("btn")

if btn.exists():
print("btn exists")
btn.click()
else:
print("btn does not exists")`

### **Traceback: **

[14:57:54][ERROR] Traceback (most recent call last):
File "airtest/cli/runner.py", line 70, in runTest
File "/Users/victor.velez/Projects/projectOne/tools/PocoAirtest.air/PocoAirtest.py", line 21, in
if btnW.exists():
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 72, in wrapped
return func(proxy, *args, **kwargs)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 782, in exists
return self.attr('visible')
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 39, in wrapped
return func(self, *args, **kwargs)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 742, in attr
nodes = self._do_query(multiple=False)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 880, in _do_query
self._nodes = self.poco.agent.hierarchy.select(self.query, multiple)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/freezeui/hierarchy.py", line 90, in select
return self.selector.select(query, multiple)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/sdk/Selector.py", line 77, in select
return self.selectImpl(cond, multiple, self.getRoot(), 9999, True, True)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/sdk/Selector.py", line 71, in getRoot
return self.dumper.getRoot()
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/freezeui/hierarchy.py", line 35, in getRoot
root = Node(self.dumpHierarchy())
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/utils/simplerpc/utils.py", line 13, in new_func
ret, err = cb.wait(timeout=30)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/utils/simplerpc/simplerpc.py", line 74, in wait
self.agent.update()
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/utils/simplerpc/rpcclient.py", line 64, in update
data = self.conn.recv()
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/utils/simplerpc/transport/tcp/main.py", line 36, in recv
msg_bytes = self.c.recv()
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/utils/simplerpc/transport/tcp/safetcp.py", line 40, in recv
trunk = self.sock.recv(size)
ConnectionResetError: [Errno 54] Connection reset by peer

======================================================================
ERROR: runTest (app.widgets.code_runner.ide_launcher.AirtestIDECase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "airtest/cli/runner.py", line 73, in runTest
File "site-packages/six.py", line 703, in reraise
File "airtest/cli/runner.py", line 70, in runTest
File "/Users/victor.velez/Projects/projectOne/tools/PocoAirtest.air/PocoAirtest.py", line 21, in
if btnW.exists():
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 72, in wrapped
return func(proxy, *args, **kwargs)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 782, in exists
return self.attr('visible')
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 39, in wrapped
return func(self, *args, **kwargs)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 742, in attr
nodes = self._do_query(multiple=False)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 880, in _do_query
self._nodes = self.poco.agent.hierarchy.select(self.query, multiple)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/freezeui/hierarchy.py", line 90, in select
return self.selector.select(query, multiple)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/sdk/Selector.py", line 77, in select
return self.selectImpl(cond, multiple, self.getRoot(), 9999, True, True)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/sdk/Selector.py", line 71, in getRoot
return self.dumper.getRoot()
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/freezeui/hierarchy.py", line 35, in getRoot
root = Node(self.dumpHierarchy())
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/utils/simplerpc/utils.py", line 13, in new_func
ret, err = cb.wait(timeout=30)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/utils/simplerpc/simplerpc.py", line 74, in wait
self.agent.update()
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/utils/simplerpc/rpcclient.py", line 64, in update
data = self.conn.recv()
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/utils/simplerpc/transport/tcp/main.py", line 36, in recv
msg_bytes = self.c.recv()
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/utils/simplerpc/transport/tcp/safetcp.py", line 40, in recv
trunk = self.sock.recv(size)
ConnectionResetError: [Errno 54] Connection reset by peer

----------------------------------------------------------------------
Ran 1 test in 120.515s

FAILED (errors=1)
[Finished]

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.