重复“从现在开始的异步会话清理阶段”

时间:2013-03-11 18:22:53

标签: testing phantomjs headless-browser

当我运行我的测试套装时,我发现间歇性的一些文本会在非常长时间(15分钟到半小时)内停留,PhantomJS会不断报告:

Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW
Asynchronous Sessions cleanup phase starting NOW ...

这是什么Asynchronous Sessions cleanup phase starting NOW以及可能导致它挂起这么久的原因?

干杯

戴夫

3 个答案:

答案 0 :(得分:1)

找到解决方案:

Asynchronous Sessions cleanup phase starting NOW ...是由对外部Feed的一些调用引起的,这些调用间歇性地缓慢。这个阶段一直在等待这些已经超时的呼叫,但PhantomJS在那里等待了很长时间。

在测试时删除这些调用(如果主机是localhost然后使用虚拟对象,则使用一点点JavaScript)解决了这个问题。

答案 1 :(得分:0)

对我有用的解决方法是将takesScreenshot功能设置为false。

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("takesScreenshot", false);

答案 2 :(得分:-2)

尝试使用     this.driver = new PhantomJSDriver(caps); 现在,我们关机了。 [INFO - 2014-05-01T13:21:09.095Z] ShutdownReqHand - _handle - 即将关闭

但是我得到了同样的pbm