5

When I run my test suit, I find that intermittently some of the texts will hang for a very long time (15 mins to half an hour) with PhantomJS constantly reporting:

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 ...

What is this Asynchronous Sessions cleanup phase starting NOW and what could be causing it to hang for so long?

Cheers

Dave

BanksySan
  • 24,077
  • 27
  • 94
  • 189

3 Answers3

1

Solution found:

The Asynchronous Sessions cleanup phase starting NOW ... was caused by some calls to external feeds, these were intermittently slow. This phase must have been waiting for these calls, which were timing out, but PhantomJS sat there waiting for a very, very long time.

Removing these calls when testing (with a wee bit of JavaScript, if host is localhost then use a dummy object) solved the problem.

BanksySan
  • 24,077
  • 27
  • 94
  • 189
  • 4
    I have the same issue. Would you like to elaborate this. – Sandeep Roniyaar Dec 04 '15 at 13:58
  • 1
    @BanksySan I am not sure what you mean by a wee bit of JavaScript, what did you do, for context? – Andrew Scott Evans Oct 13 '16 at 20:45
  • @BanksySan yea a bit of context could really help me out – Finbar Maginn Mar 20 '17 at 16:19
  • Sorry @FinbarMaginn, this was four years ago. – BanksySan Mar 20 '17 at 17:00
  • @FinbarMaginn OK... I vaguely remember what it was about. We had calls out to some API that wasn't accessable from the development machine and, rather than 503-ing quickly would timeout instead. I _think_ I just disabled the object making those calls with some config (`if environment == 'development' then set the object that was making the calls to a dummy object1). – BanksySan Mar 20 '17 at 17:03
0

The workaround that worked for me is to set the takesScreenshot capability to false.

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("takesScreenshot", false);
Vjeetje
  • 4,914
  • 3
  • 31
  • 52
  • This is not the solution unless you are outputting the screenshot somewhere that does not exist. It is a good idea but there is also a matter of the cache, file system; etc which may be to blame. I am trying to run intensive tests in LXC containers with more isolated resource allocation as I am thinking this will get rid of the issues I am having with all webdrivers. – Andrew Scott Evans Oct 19 '16 at 16:23
-2

try to use this.driver = new PhantomJSDriver(caps); Now, we get a shutdown. [INFO - 2014-05-01T13:21:09.095Z] ShutdownReqHand - _handle - About to shutdown

But After I got the same pbm

Wal
  • 21
  • 4