When running cucumber 1.1.9 tests using capybara 2.0.2 and poltergeist 1.1.0 on jruby 1.7.3 I see intermittent errors like the following:
Scenario: Recover username for a valid email # features/user/recover_username.feature:14
Undefined method reset_id! for module '#<Module:0xac1f53d>' (NameError)
org/jruby/RubyModule.java:2284:in `undef_method'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activemodel-3.2.13/lib/active_model/attribute_methods.rb:279:in `undefine_attribute_methods'
org/jruby/RubyArray.java:1613:in `each'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activemodel-3.2.13/lib/active_model/attribute_methods.rb:279:in `undefine_attribute_methods'
org/jruby/RubyModule.java:2291:in `module_eval'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activemodel-3.2.13/lib/active_model/attribute_methods.rb:278:in `undefine_attribute_methods'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activerecord-3.2.13/lib/active_record/attribute_methods.rb:85:in `undefine_attribute_methods'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activerecord-3.2.13/lib/active_record/attribute_methods/read.rb:37:in `undefine_attribute_methods'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activerecord-3.2.13/lib/active_record/model_schema.rb:299:in `reset_column_information'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activerecord-jdbc-adapter-1.2.7/lib/arjdbc/jdbc/base_ext.rb:10:in `reset_column_information_with_arjdbc_base_ext'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activerecord-3.2.13/lib/active_record/session_store.rb:112:in `setup_sessid_compatibility!'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activerecord-3.2.13/lib/active_record/session_store.rb:100:in `find_by_session_id'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activerecord-3.2.13/lib/active_record/session_store.rb:308:in `get_session'
/Users/jnorton/workspace/echo-reverb-rails/config/initializers/buffered_logger_silencer_fix.rb:18:in `silence'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activerecord-3.2.13/lib/active_record/session_store.rb:307:in `get_session'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:251:in `load_session'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/actionpack-3.2.13/lib/action_dispatch/middleware/session/abstract_store.rb:49:in `load_session'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/actionpack-3.2.13/lib/action_dispatch/middleware/session/abstract_store.rb:57:in `stale_session_check!'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/actionpack-3.2.13/lib/action_dispatch/middleware/session/abstract_store.rb:49:in `load_session'
org/jruby/RubyBasicObject.java:1683:in `__send__'
org/jruby/RubyKernel.java:2107:in `send'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:135:in `load!'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:127:in `load_for_read!'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:59:in `[]'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/actionpack-3.2.13/lib/action_dispatch/middleware/flash.rb:238:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/actionpack-3.2.13/lib/action_dispatch/middleware/cookies.rb:341:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activerecord-3.2.13/lib/active_record/query_cache.rb:64:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:28:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:408:in `_run__1481551955__call__1911249458__callbacks'
org/jruby/RubyBasicObject.java:1677:in `__send__'
org/jruby/RubyKernel.java:2103:in `send'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:390:in `_run_call_callbacks'
org/jruby/RubyBasicObject.java:1677:in `__send__'
org/jruby/RubyKernel.java:2103:in `send'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/actionpack-3.2.13/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/actionpack-3.2.13/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/actionpack-3.2.13/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/cucumber-rails-1.3.0/lib/cucumber/rails/action_controller.rb:10:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/railties-3.2.13/lib/rails/rack/logger.rb:32:in `call_app'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/activesupport-3.2.13/lib/active_support/tagged_logging.rb:22:in `tagged'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/actionpack-3.2.13/lib/action_dispatch/middleware/request_id.rb:22:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/actionpack-3.2.13/lib/action_dispatch/middleware/static.rb:63:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/railties-3.2.13/lib/rails/engine.rb:479:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/railties-3.2.13/lib/rails/application.rb:223:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/rack-1.4.5/lib/rack/builder.rb:134:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/rack-1.4.5/lib/rack/urlmap.rb:64:in `call'
org/jruby/RubyArray.java:1613:in `each'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/capybara-2.0.2/lib/capybara/server.rb:19:in `call'
/Users/jnorton/workspace/echo-reverb-rails/vendor/bundle/jruby/1.9/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'
/Users/jnorton/.rvm/rubies/jruby-1.7.3/lib/ruby/1.9/webrick/httpserver.rb:138:in `service'
/Users/jnorton/.rvm/rubies/jruby-1.7.3/lib/ruby/1.9/webrick/httpserver.rb:94:in `run'
/Users/jnorton/.rvm/rubies/jruby-1.7.3/lib/ruby/1.9/webrick/server.rb:191:in `start_thread'
The test will invariably pass when run a second time.
This happens less than 5% of the time, but enough to break CI. These errors are not the typical timing issues causing a page element to not be located; they occur at the start of a scenario before any steps are executed.
This looks to me like some kind of race condition that is causing some classes/modules to be loaded in the wrong order, but I have not looked deeply into it yet. I wanted to ask here to see if this was a known issue with some sort of solution/work around.