casperjs测试冻结导致jenkins构建超时

时间:2014-07-07 23:18:08

标签: javascript jenkins automation phantomjs casperjs

我在登台环境中使用jenkins运行casperjs测试。最近jenkins已经超时(10分钟)并且几乎总是因为casper测试。套件中有4个测试,平均成功构建大约需要1分30秒。

当我在本地进行单独测试时,我有时可以重现这一点 - casper似乎只是卡住了。一个值得注意的事情似乎总是在一个加载新页面的动作(一个URL更改)。

这是一个非常简单的登录测试的日志:

[info] [phantom] Starting...
[info] [phantom] Running suite: 12 steps
[debug] [phantom] opening url: http://mytestsite.dev/log_in, HTTP GET
[debug] [phantom] Navigation requested: url=http://mytestsite.dev/log_in, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "http://mytestsite.dev/log_in"
[debug] [phantom] Successfully injected Casper client-side utilities
[debug] [phantom] start page is loaded
[info] [phantom] Step anonymous 3/12 http://mytestsite.dev/log_in (HTTP 200)
logging in
[info] [remote] attempting to fetch form element from selector: '#login_form'
[debug] [remote] Set "email" field value to test.user@gmail.com
[debug] [remote] Set "password" field value to ***********
[info] [phantom] Step anonymous 3/12: done in 445ms.
[info] [phantom] Step anonymous 4/12 http://mytestsite.dev/log_in (HTTP 200)
[debug] [phantom] Mouse event 'mousedown' on selector: xpath selector: //*[@id="login_form"]/span[3]/input
[debug] [phantom] Mouse event 'mouseup' on selector: xpath selector: //*[@id="login_form"]/span[3]/input
[debug] [phantom] Mouse event 'click' on selector: xpath selector: //*[@id="login_form"]/span[3]/input
[info] [phantom] Step anonymous 4/12: done in 466ms.
[debug] [phantom] Navigation requested: url=http://mytestsite.dev/log_in, type=FormSubmitted, willNavigate=true, isMainFrame=true
[debug] [phantom] Navigation requested: url=http://mytestsite.dev/home, type=FormSubmitted, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "http://mytestsite.dev/home"

它冻结,然后构建超时。这种情况在过去几周内开始发生。

[编辑] 当我尝试运行此测试时,也可以间歇性地发生这种情况 - https://gist.github.com/n1k0/4509789

关于如何调试的任何想法?

0 个答案:

没有答案