PhantomJS timeout

390 views
Skip to first unread message

Kashif Usmani

unread,
May 30, 2013, 5:55:05 PM5/30/13
to phan...@googlegroups.com
I am using Jasmine with PhantomJS to run test cases.
In my typical test case, I make a service call, wait for response and confirm response.
Some requests can return in a few seconds and some can take up to a minute to return.
When ran through PhantomJS, the test case fails for the service call that is supposed to take a minute ( fails because the response is not yet received).
What's interesting is that the test passes when ran through Firefox.
I have tried looking at tcpdump and the headers are same for requests through both browsers, so this looks like a browser timeout issue.
Has anyone had a similar issue ? Any ideas as to where could the timeout be configured ? Or do you think the problem is something else ?


Thanks
Kashif

Didier

unread,
May 31, 2013, 11:50:48 AM5/31/13
to phan...@googlegroups.com
It sounds like it could be related to my issue.

I've noticed that the XMLHttpRequest.Send method that phantom uses seems to timeout and return a cross domain policy error when the request takes too long, above 30 second, to reply. The one in Firefox and Chrome does not, so this might explain why you only get this in PhantomJS.

James Greene

unread,
May 31, 2013, 3:05:52 PM5/31/13
to phan...@googlegroups.com
Is it a synchronous or asynchronous request?

Sincerely,
    James Greene



--
You received this message because you are subscribed to the Google Groups "phantomjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phantomjs+...@googlegroups.com.
Visit this group at http://groups.google.com/group/phantomjs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Kashif Usmani

unread,
May 31, 2013, 5:17:33 PM5/31/13
to phan...@googlegroups.com
ah the pain of PhantomJS.
Apparently it turned out that I was using javascript's bind function which is not supported in PhantomJS . This was causing the test to fail which resulted in messing up state of some global variable( my fault) and hence the failure.
But the root cause was using bind.
Solution: try getting a shim for bind


--
You received this message because you are subscribed to a topic in the Google Groups "phantomjs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phantomjs/prhe0UV0yHM/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to phantomjs+...@googlegroups.com.

Kashif Usmani

unread,
May 31, 2013, 5:52:48 PM5/31/13
to phan...@googlegroups.com

Roger Giuffre

unread,
Sep 14, 2013, 11:27:02 AM9/14/13
to phan...@googlegroups.com
Hello, i'm findind the solution about this type of problem.

How i can use shim to resolve this problem?

Thanks

Kashif Usmani

unread,
Sep 15, 2013, 2:24:11 PM9/15/13
to phan...@googlegroups.com

Get the shim here:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind


To unsubscribe from this group and all its topics, send an email to phantomjs+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages