并发 高并发_实习生并发问题

并发 高并发

Update: I've found the root issue and have detailed it at the end of this post.

更新:我已经找到了根本问题,并在本文结尾处进行了详细说明。

Over the past year I've created and implemented Selenium testing on the Mozilla Developer Network using the Intern interface created by SitePen.  Intern's been awesome;  sure there's a learning curve with async JavaScript coding but it's simple when you get the hang of it.

在过去的一年中,我已经使用SitePen创建的Intern接口在Mozilla开发人员网络上创建并实施了Selenium测试。 实习生很棒 确保异步JavaScript编码有一个学习曲线,但是掌握了它很简单。

One problem I encountered with functional testing via service like BrowserStack and Sauce Labs is that we get failures we generally don't get  when testing locally.  When I tested with one browser everything went well but testing multiple browsers sent our tests into a spiral of transient failures.  When I tweaked one setting, however, everything went to plan:

我通过BrowserStack和Sauce Labs等服务进行功能测试时遇到的一个问题是,我们遇到了在本地测试时通常不会遇到的失败。 当我使用一个浏览器进行测试时,一切都进行得很好,但是测试多个浏览器使我们的测试陷入了瞬态故障的漩涡。 但是,当我调整一个设置时,一切都按计划进行:


// Maximum number of simultaneous integration tests that should be executed on the remote WebDriver service
maxConcurrency: 1,


Setting the maxConcurrency value down to 1 was all we needed to do.  Instead of all browsers spawning at once, each test runs within one browser and then within another.  Bingo!

我们要做的就是将maxConcurrency值设置为1。 每个测试都在一个浏览器中运行,然后在另一个浏览器中运行,而不是立即生成所有浏览器。 答对了!

As to what was causing the ultimate issue, I'm not quite sure.  The tests included authorization and login testing so it's possible there were overlaps in signing in and out, causing confusion on the server side.  Regardless, if you need to get things moving quickly, limit the maxConcurrency setting and you may start seeing loads more test passes.

至于导致最终问题的原因,我不太确定。 测试包括授权和登录测试,因此登录和注销之间可能存在重叠,从而导致服务器端混乱。 无论如何,如果您需要快速运行,请限制maxConcurrency设置,您可能会开始看到加载更多的测试通过次数。

更新:Firefox + Focus + Selenium Bug (Update: Firefox + Focus + Selenium Bug)

After loads of testing and digging, I found the root issue for my problems with tests passing when one browser is run and not when run concurrently: when Firefox is not the focused/"on top" browser, focus events don't get passed up. And in my specific case, I was testing CSS animations, and those don't occur when a browser isn't focused. Hopefully this bug is fixed in Selenium too!

经过大量的测试和挖掘,我发现了运行一个浏览器而不是同时运行时通过测试的问题的根本问题: 当Firefox不是焦点/“顶部”浏览器时,焦点事件不会被忽略 。 在我的特定情况下,我正在测试CSS动画,并且当浏览器不集中时不会出现这些动画。 希望这个错误也可以在Selenium中修复!

翻译自: https://davidwalsh.name/intern-concurrency-problem

并发 高并发

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值