PhantomJS很长一段时间说“现在开始asynchronous会话清理阶段”

这是一个截图:

PhantomJS等待一些电话

task : Codeception PHP Testing Framework v1.6.2 Powered by PHPUnit 3.7.19 by Sebastian Bergmann. Suite selenium_acceptance started Trying to see the welcome page of newweather (welcomeCept.php) issue : it sits as it is and waiting for phantomJS to respond and below is what phantomJS screen is showing : [INFO - 2014-03-13T01:42:51.575Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: ca14e740-aa50-11e3-bb6b-75468ba86108 [INFO - 2014-03-13T01:47:42.806Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW [INFO - 2014-03-13T01:52:42.806Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW [INFO - 2014-03-13T01:57:42.806Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW 

它坐在屏幕上没有结果。

这是我使用的:

  • PhantomJS版本:1.9.7
  • 运行在端口4444上

只有半相关的答案我能find以下内容:

“从NOW开始的asynchronous会话清理阶段是由于一些对外部提要的调用引起的,这些调用是间歇性的,这个阶段一定是等待这些调用,但是PhantomJS坐在那里等待一个非常非常长时间。

testing时删除这些调用(使用一小段JavaScript,如果主机是localhost,则使用虚拟对象)解决了这个问题。

在这里find: 重复“现在开始的asynchronous会话清理阶段”

所以这个问题很可能是由于外部的feed / API调用超时造成的。

Github问题: https : //github.com/ariya/phantomjs/issues/11526

解决方法是为我设置的takeScreenshotfunction为false。

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

一年前我遇到了同样的问题。 我发现了一个肮脏的黑客。 我用nginx的其他服务器,我代理所有查询所需的testing版本。 我把我的testingredirect到代理服务器,现在我没有这个错误。 自2016年4月以来,testing每天都在进行,没有任何错误。