簡體   English   中英

打開的文件太多運行機器人框架測試用例時看到錯誤

[英]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

您必須增加計算機上最大打開文件數。

是一篇文章如何在ubuntu中完成。

在SO上也回答了類似的問題

可以打開的最大文件數越來越多(例如Hinata提出的)確實是一種短期解決方案,但是我很驚訝您首先達到了此限制。 我不明白為什么連續的GET會打開這么多文件。

我的建議是嘗試另一個庫以檢查是否仍然存在此問題。 您可以嘗試一個Robot Framework Requests ,也可以直接調用Requests Python lib。 您可能想看看有關我撰寫的有關此主題簡短博客文章

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM