简体   繁体   English

处理Sauce Labs中的超时

[英]Dealing with timeouts in Sauce Labs

I have Web Driver code that works without issue when running on a local instance of a browser. 我有一个Web驱动程序代码,在浏览器的本地实例上运行时没有问题。 My code interacts with the browser, but has a period where it kicks off some background tasks via terminal in order to set up data for the remainder of the test. 我的代码与浏览器交互,但有一段时间,它通过终端启动一些后台任务,以便为测试的其余部分设置数据。 This is an end to end test and it needs to execute in this order, leaving the browser idle for a short period of time, usually under 5 minutes. 这是一个端到端测试,它需要按此顺序执行,让浏览器空闲一小段时间,通常不到5分钟。 After the background tasks complete, the browser is then again interacted with. 后台任务完成后,浏览器再次与之交互。

Unfortunately when I run my rests remotely from Sauce Labs, when running the background tasks Sauce Labs finds the browser as being inactive for longer than 90 seconds and assumes there is an issue. 不幸的是,当我从Sauce Labs远程运行我的休息时,在运行后台任务时,Sauce Labs发现浏览器处于非活动状态超过90秒并假设存在问题。 This results in a failure even though the test never fails. 即使测试从未失败,这也会导致失败。 I can't seem to find anything in the documentation regarding how to increase the idle timeout. 我似乎无法在文档中找到有关如何增加空闲超时的任何内容。 Is there a way to do this? 有没有办法做到这一点?

Saucelabs has a few different types of timeouts: Saucelabs有几种不同类型的超时:

  • Max test duration 最长测试持续时间
  • Command timeout 命令超时
  • Idle test timeout 空闲测试超时

More info: https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options#TestConfigurationOptions-Timeouts 更多信息: https//wiki.saucelabs.com/display/DOCS/Test+Configuration+Options#TestConfigurationOptions-Timeouts

Either the max duration or idle timeout should help you out. 最大持续时间或空闲超时应该可以帮助您。 I think the idle time still burns down sauce test minutes though. 我认为闲置的时间仍然会耗尽酱油测试时间。

when you set up your desired_capabilities add: 当你设置desired_capabilities时添加:

desired_capabilities["idle-timeout"] = "180"

I did 180 seconds here, but you can do whatever... 我在这里做了180秒,但你可以做任何事......

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

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