简体   繁体   English

如果 Appium 使用 Python 失败并出现 SessionNotCreated 异常,则无法停止节点进程

[英]Failed to stop node process if Appium fails with SessionNotCreated exception using Python

I'm running automation test for 10 iOS devices for Safari browser in parallel but during the test I noticed that randomly Appium fails with exception我正在为 Safari 浏览器并行运行 10 个 iOS 设备的自动化测试,但在测试期间我注意到 Appium 随机失败并出现异常

SessionNotCreated

When such exception happens then the Appium connection fails but it fails to kill the process (Appium process is started by node) This cause a lot of memory usage for the device.当发生此类异常时,Appium 连接失败但无法终止进程(Appium 进程由节点启动)这会导致设备大量使用 memory。

Any suggestions to handle such conditions?有什么建议来处理这种情况?

Thanks in advance提前致谢

  1. Tried to rerun appium whenever there is an exception每当出现异常时尝试重新运行 appium
  2. Killing the process id for the Port where appium was running but it results in killing the whole script杀死运行 appium 的端口的进程 ID,但会导致杀死整个脚本
  3. Added random waits to avoid 10 parallel tests starting at the same time添加随机等待以避免 10 个并行测试同时开始

Fixed using os.kill from python固定使用来自 python 的 os.kill

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM