[英]Too many open files Error is seen when we run robot framework test cases
我有一個包含300個測試用例的測試套件。 這些測試用例是HTTP API調用。 都是“ GET” API調用。 最初的測試用例執行良好。 但是在執行結束時,將引發錯誤“錯誤:[Errno 24]打開的文件太多”。 即使我們在被測試的系統中沒有任何功能問題,這也會導致測試用例失敗。
如何解決這個問題?
報告中的錯誤是:
error: [Errno 24] Too many open files
08:55:00.484 DEBUG Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/HttpLibrary/__init__.py", line 229, in GET
self.app.get(path, {}, self.context.request_headers)
File "/Library/Python/2.7/site-packages/webtest/app.py", line 286, in get
File "/Library/Python/2.7/site-packages/HttpLibrary/livetest.py", line 153, in do_request
File "/Library/Python/2.7/site-packages/HttpLibrary/livetest.py", line 126, in _do_httplib_request
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 973, in request
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1007, in _send_request
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 969, in endheaders
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 829, in _send_output
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 791, in send
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 772, in connect
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 571, in create_connection
可以打開的最大文件數越來越多(例如Hinata提出的)確實是一種短期解決方案,但是我很驚訝您首先達到了此限制。 我不明白為什么連續的GET會打開這么多文件。
我的建議是嘗試另一個庫以檢查是否仍然存在此問題。 您可以嘗試一個Robot Framework Requests ,也可以直接調用Requests Python lib。 您可能想看看有關我撰寫的有關此主題的簡短博客文章 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.