在jruby上用水豚和恶作剧进行黄瓜测试的间歇性错误

时间:2013-04-19 16:17:42

标签: cucumber capybara poltergeist

在jruby 1.7.3上使用capybara 2.0.2和poltergeist 1.1.0运行黄瓜1.1.9测试时,我看到如下的间歇性错误:

  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'

测试将在第二次运行时不变。

这种情况发生的时间不到5%,但足以打破CI。这些错误不是导致页面元素无法定位的典型时序问题;它们发生在任何步骤执行之前的场景开始。

这看起来像某种竞争条件导致某些类/模块以错误的顺序加载,但我还没有深入研究它。我想问一下,看看这是一个已知问题,是否有某种解决方案/解决方法。

0 个答案:

没有答案