AirtestProject / AirtestProject/Airtest
同时运行多个case,总有case跑失败,经常报BrokenPipeError: [Errno 32] Broken pipe
- 主要語言
- Python
- 星號
- 9.6k
- 分支
- 1.5k
- PR 合併指標
- 30 天內沒有已合併 PR
描述
前置条件:
机型:电脑:macOS Mojave 10.14.5 手机:iphone8p 系统11.0 xcode 11.2.1
使用unittest框架,一个接着一个跑case,总会有case跑失败;而这些case单独一个个在airtest客户端内调试是成功的
报错如下:
`Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 357, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 986, in send
self.sock.sendall(data)
BrokenPipeError: [Errno 32] Broken pipe
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
timeout=timeout
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 357, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python3.6/site-packages/urllib3/packages/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 357, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 986, in send
self.sock.sendall(data)
urllib3.exceptions.ProtocolError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/airtest/utils/logwraper.py", line 72, in wrapper
res = f(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/airtest/core/api.py", line 259, in touch
try_log_screen()
File "/usr/local/lib/python3.6/site-packages/airtest/utils/logwraper.py", line 72, in wrapper
res = f(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/airtest/core/cv.py", line 97, in try_log_screen
screen = G.DEVICE.snapshot()
File "/usr/local/lib/python3.6/site-packages/airtest/core/ios/ios.py", line 159, in snapshot
data = self._neo_wda_screenshot() # wda 截图不用考虑朝向
File "/usr/local/lib/python3.6/site-packages/airtest/core/ios/ios.py", line 143, in _neo_wda_screenshot
value = self.driver.http.get('screenshot').value
File "/usr/local/lib/python3.6/site-packages/wda/__init__.py", line 129, in fetch
return self._fetch_no_alert(method, url, data)
File "/usr/local/lib/python3.6/site-packages/wda/__init__.py", line 135, in _fetch_no_alert
return httpdo(target_url, method, data)
File "/usr/local/lib/python3.6/site-packages/wda/__init__.py", line 95, in httpdo
response = requests.request(method, url, json=data, timeout=HTTP_TIMEOUT)
File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 502, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 490, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))`
貢獻指南
這個儲存庫沒有索引到貢獻指南
評估
這個 Issue 還沒有評估資料。