rspec-rails: Upgrading rspec to 3.7.0 causes 'Error in reactor loop'.

When upgrading rspec and rspec-rails from 3.6.0 resp. 3.6.1 to 3.7.0 resp. 3.7.1, my tests fail in a loop, with the following stacktrace:

Error in reactor loop escaped: Invalid argument (Errno::EINVAL)
/Users/xxx/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/puma-3.10.0/lib/puma/reactor.rb:29:in `select'
/Users/xxx/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/puma-3.10.0/lib/puma/reactor.rb:29:in `run_internal'
/Users/xxx/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/puma-3.10.0/lib/puma/reactor.rb:154:in `block in run_in_thread'

Downgrading Puma does not resolve the issue. Note, I also use capybara 2.13.0 and capybara-webkit 1.14.0.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 20 (7 by maintainers)

Most upvoted comments

Closing as stale for now, if there is any interest in this let us know and we will reopen.

Same if you could provide a reproduction case that involves rspec-rails. 😊

I am also getting this on 3.11.4. We are using Timecop.

So far I have noticed that the error occurs if Timecop.freeze is called after puma has already been started by capybara.

Hi @mileslane that patch is for Puma, I suggest asking them if they would welcome it for inclusion. There is nothing for RSpec to do at this time.

Closing as stale for now, if there is any interest in this let us know and we will reopen.

Same if you could provide a reproduction case that involves rspec-rails. 😊

Please reopen this and apply the patch. I am getting this problem with a project:

.rvm/gems/ruby-2.5.3/gems/puma-3.12.1/lib/puma/reactor.rb:128:in `select'
.rvm/gems/ruby-2.5.3/gems/puma-3.12.1/lib/puma/reactor.rb:128:in `run_internal'
.rvm/gems/ruby-2.5.3/gems/puma-3.12.1/lib/puma/reactor.rb:253:in `block in run_in_thread'
Error in reactor loop escaped: Invalid argument (Errno::EINVAL)

Gemfile includes:

Using capybara 3.15.0 Using puma 3.12.1 Using rspec-core 3.8.0 Using timecop 0.9.1

package.json includes:

“ember-ajax”: “4.0.2”, “ember-cli”: “❤️.5.0”, “ember-cli-emblem”: “0.12.0”, “ember-cli-qunit”: “4.4.0”, “ember-cli-rails-addon”: “0.10.0”, “ember-cli-sass”: “7.2.0”, “ember-qunit”: “4.4.1”, “qunit”: “2.9.2”

Alternative quick-fix tip - don’t travel to future, travel to past only

After some investigations, in our case these errors are happening only when dates are stubbed to future date. When stubbed to past date there is no errors (guess because delta is negative 😄 ), so… just refactored everything to past.

you mean Capybara.server = :webrick with only one ‘b’ I guess ?

This is probably related to our system test integration, try setting Capybara.server = :webbrick as a work around until we resolve the teething troubles we’ve been having.