Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase Capybara wait time for the problematic selector #4296

Conversation

Projects
None yet
2 participants
@jonatanklosko
Copy link
Member

commented Jul 10, 2019

An attempt of fixing intermittent test failure pointed out here, as it happens frustratingly often. I run the spec locally in a loop until it failed, but I couldn't reproduce this exact failure. The proposed solution is to wait a little bit more for the selector to be found (3s instead of the default 2s), so it's less likely to suffer from modal hidding slowly (a wild guess).

@jonatanklosko

This comment has been minimized.

Copy link
Member Author

commented Jul 10, 2019

Travis proved me wrong immediately, oh well...

  1) Competition events management unconfirmed competition change round attributes change cutoff to best of 2 in 2 minutes
     Failure/Error: first(:button, "save your changes!", visible: true).click
     
     Capybara::ExpectationNotMet:
       expected to find button "save your changes!" that is not disabled at least 1 time but there were no matches
     # /home/travis/.bundle/ruby/2.5.0/gems/capybara-3.25.0/lib/capybara/node/finders.rb:253:in `block in all'
     # /home/travis/.bundle/ruby/2.5.0/gems/capybara-3.25.0/lib/capybara/node/base.rb:83:in `synchronize'
     # /home/travis/.bundle/ruby/2.5.0/gems/capybara-3.25.0/lib/capybara/node/finders.rb:251:in `all'
     # /home/travis/.bundle/ruby/2.5.0/gems/capybara-3.25.0/lib/capybara/node/finders.rb:281:in `first'
     # /home/travis/.bundle/ruby/2.5.0/gems/capybara-3.25.0/lib/capybara/session.rb:749:in `block (2 levels) in <class:Session>'
     # /home/travis/.bundle/ruby/2.5.0/gems/capybara-3.25.0/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
     # ./spec/features/competition_manage_schedule_spec.rb:49:in `save'
     # ./spec/features/competition_events_spec.rb:94:in `block (4 levels) in <top (required)>'
@jfly

This comment has been minimized.

Copy link
Member

commented Jul 14, 2019

Oh wow. I didn't realize capybara only waits 2 seconds by default. I'd be supportive of changing this to something really long (like 1 minute) so we can distinguish between "this took a little while" and "this was probably never going to happen".

@jfly

This comment has been minimized.

Copy link
Member

commented Jul 14, 2019

Oh, nevermind, apparently setting it to something long is not a great idea because it will slow down checks like "make sure this thing doesn't exist". See https://blog.tomoyukikashiro.me/post/things-to-be-aware-of-when-change-capybara_default_wait_time for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.