HttpRunner httprunner 执行用例,概率性的报错 init session runner failed error="init plugin failed: connect grpc plugin failed

Kingo-V · 2024年01月05日 · 最后由 Kingo-V 回复于 2024年01月23日 · 6116 次阅读

hrp version v4.2.0

6:11PM INF start to prepare python plugin output="E:\PyWorkSpace\hq_ebs_api_test2\.debugtalk_gen.py" path="E:\PyWorkSpace\hq_ebs_api_test2\debugtalk.
py"
6:11PM INF exec command cmd="C:\Windows\system32\cmd.exe /c C:\Users\Kingo\.hrp\venv\Scripts\python.exe -m py_compile E:\PyWorkSpace\hq_ebs_api_
test2\debugtalk.py"
6:11PM INF find all function names functionNames=["get_sellorderitem_id","get_ramdon_phone","get_uuid","get_user_agent","isEqual","getTimeStamp","timeToDat
e","getDateTime","getDate","dateCalculate","generatePN","sleep","concatListToStr","getListExpenseItem","getNormalizedListExpenseItem","getSellOrderItem","g
etCustomerAddress","getCustomerPrincipals","getVendorBankInfo","getFilename","getFileSize","ossFileUpload","get_cname","get_ename","get_company_ename","get
_telphone_num","get_company_name","get_addr","get_mail","get_bank","get_bank_acount","get_qq_num","get_fax","get_postcode","get_DUNS","get_net","get_TaxNum
ber","get_wechat","get_limit_num","get_random_num","hqbuypool_token"]
6:11PM INF set python3 executable path Python3Executable="C:\Users\Kingo\.hrp\venv\Scripts\python.exe"
6:11PM ERR init plugin failed: E:\PyWorkSpace\hq_ebs_api_test2.debugtalk_gen.py error="connect grpc plugin failed: Unrecognized remote plugin message: \n\
nThis usually means that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol."
6:11PM ERR [Run] init session runner failed error="init plugin failed: connect grpc plugin failed: Unrecognized remote plugin message: \n\nThis usually mea
ns that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol."
6:11PM INF quit hashicorp plugin process
2024-01-05T18:11:14.295+0800 [WARN] grpc-py: plugin failed to exit gracefully
PS E:\PyWorkSpace\hq_ebs_api_test2>

共收到 5 条回复 时间 点赞

可以去排查你的 debugtalk.py,你自己写的方法 httprunner 它不支持

他是概率性的报错,不是必现。自定义方法的问题可能性较小。怀疑是 重复初始化 plugin 产生大量 python 进程导致的

基本确认是每次执行产生大量 python 进程,不会自动结束进程导致内存溢出,程序运行失败导致的。每次执行完手动关闭 pycharm 终端,结束 python 进程很少有这种情况发送了。

我也老遇到这个问题 有什么解决方法吗

luck1xy 回复


每次执行完记得关闭重开下终端。 如果是 cmd 脚本执行,记得最后 exit 关闭命令窗口。这样就能结束当前执行产生的 python 进程。

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册