Closed DeeDeeG closed 6 years ago
If you run it with selenium
as the driver you can see the same things happens, and see the browser is waiting for a request from csi.gstatic.com
. The issue appears to be that the map display hangs requesting resources to populate the iframe it adds to the page. You can get the tests to run (some fail) by configuring the driver to ignore JS errors and blacklist googleapis.com
-
Capybara::Poltergeist::Driver.new(app,
:js_errors => false,
url_blacklist: ['googleapis.com']
)
This means you won't actually be able to test anything relating to the map, but I'm not sure what else can be done if the map display just hangs.
Thanks for the response and explanation. It looks like this is not a Poltergeist or PhantomJS bug after all.
@DeeDeeG Well there is an issue in that Poltergeist currently doesn't allow setting the PhantomJS resourceTimeout - http://phantomjs.org/api/webpage/property/settings.html - which I think would prevent this from hanging (not actually tested that though).
Our tests see this error about 15% of the time. We need to re-run the tests up to four times to get tests to pass.
"Capybara::Poltergeist::TimeoutError: Timed out waiting for response to {"id":"bb64b980-a6bb-4671-93e7-4931873d9411","name":"visit","args":["http://localhost:3003/dashboard"]}"
@thebradhimself And have you tried increasing the timeout in your Poltergeist config?? The error is telling you that your page at "http://localhost:3003/dashboard" isn't returning within the allotted time, check your test log to see why it's so slow or increase the allowed time.
@thebradhimself Are you using sprockets? Isn't first request compiling assets?
Setting the timeout to be way higher did the tricker @twalpole , thank you!
Meta
Poltergeist Version: 1.16.0 PhantomJS Version: 2.1.1
Expected Behavior
Poltergeist should not have time outs when running our CI tests.
Actual Behavior
I am a member of the volunteer team over at Refuge Restrooms. We use Capybara and Poltergeist in a lot of our continuous integration tests.
This time out error started happening out of the blue for a few of our sub-tests, and since then every CI run has these time outs (on the same sub-tests, I think). It did not happen after any particular change in our repo, as far as we can tell.
We did try increasing the timeout to 60, and a bunch of other things, but none of them eliminated or reduced the errors.
Steps to reproduce
Two options:
Clone our git repo and run our CI tests. (You can test on your machine by following instructions at our repo, or simply open a pull request against our repo to trigger automatic CI on that PR.)
In lieu of reproducing the problem yourselves, see our Travis CI logs: https://travis-ci.org/RefugeRestrooms/refugerestrooms/
(If we can be more helpful by providing the compiled haml --> html of our page, or snippets of our Cucumber/RSpec tests, or generally providing more info, let us know. Thank you.)