RefugeRestrooms / refugerestrooms

REFUGE restrooms indexes and maps safe restroom locations for trans, intersex, and gender nonconforming individuals.
http://www.refugerestrooms.org
GNU Affero General Public License v3.0
894 stars 261 forks source link

CI is failing on certain tests that use Poltergeist #469

Closed DeeDeeG closed 6 years ago

DeeDeeG commented 6 years ago

Starting this issue to track efforts to solve this problem.

Routes to solve the problem:

Switching away from Poltergeist is supposed to be pretty easy, and should not require re-writing any tests. Capybara abstracts away all browser capabilities, and since we use Capybara, we should be able to easily swap out any headless browser compatible with Capybara.

Past attempts to fix this:

DeeDeeG commented 6 years ago

Filed an issue upstream at the Poltergeist repo in case this might be a genuine bug in Poltergeist: https://github.com/teampoltergeist/poltergeist/issues/917

DeeDeeG commented 6 years ago

Comment in the upstream issue:


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.

DeeDeeG commented 6 years ago

So, this probably isn't a Poltergeist or PhantomJS bug; it happens even with Selenium, which I think uses Firefox. (In any case, Selenium has nothing to do with Poltergeist.)

This looks like a problem on the Maps API side. Maybe our maps API quota is being maxed out? Or some other issue with GMaps?

mi-wood commented 6 years ago

Thanks @DeeDeeG that's a huge help! I think I'm going to disable those tests for now in favor of having all tests run, and we can create an issue about map tests.

mi-wood commented 6 years ago

Actually, this is hanging in production too, so I'll try to figure out what's up.

mi-wood commented 6 years ago

This is fixed here: https://github.com/RefugeRestrooms/refugerestrooms/pull/457

Just stopped using the experimental version of the maps API

mi-wood commented 6 years ago

Fix is now deployed