#1376 ✓resolved
Kevin Watt

undefined method `reset_runtime' for DataMapper::Adapters::MysqlAdapter

Reported by Kevin Watt | July 25th, 2010 @ 01:20 AM

I'm now getting this with rspec tests:

1) TopicsController GET index assigns all boards as @boards
Failure/Error: get :index
undefined method reset_runtime' for #<DataMapper::Adapters::MysqlAdapter:0x104160ad0><br/> /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/dm-rails-1.0.0/lib/dm-rails/railties/controller_runtime.rb:18:incleanup_view_runtime' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/instrumentation.rb:38:in render' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/implicit_render.rb:10:indefault_render' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/implicit_render.rb:5:in send_action' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/abstract_controller/base.rb:145:inprocess_action' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/rendering.rb:11:in process_action' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/abstract_controller/callbacks.rb:18:inprocess_action' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb:468:in _run__599332899__process_action__199225275__callbacks' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb:408:insend' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb:408:in _run_process_action_callbacks' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb:88:insend' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.0.beta4/lib/active_support/callbacks.rb:88:in run_callbacks' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/abstract_controller/callbacks.rb:17:inprocess_action' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/instrumentation.rb:29:in process_action' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.0.beta4/lib/active_support/notifications/instrumenter.rb:20:ininstrument' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.0.beta4/lib/active_support/notifications.rb:48:in __send__' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.0.beta4/lib/active_support/notifications.rb:48:ininstrument' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/instrumentation.rb:28:in process_action' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/rescue.rb:8:inprocess_action' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/abstract_controller/base.rb:114:in process' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/abstract_controller/rendering.rb:40:inprocess' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/testing.rb:12:in process_with_new_base_test' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/action_controller/test_case.rb:392:inprocess' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/actionpack-3.0.0.beta4/lib/action_controller/test_case.rb:330:in get' ./spec/controllers/topics_controller_spec.rb:47 Any tips? It happens both with and without using the database_cleaner start/clean steps. It only seems to happen with the first rspec test, strange.<br/> describe "GET index" do<br/> it "assigns all boards as @boards" do<br/> get :index # lazy loading will screw this up? assigns(:boards).should == Board.all end<br/> end

A workaround seems to be this:
class DataMapper::Adapters::AbstractAdapter
def reset_runtime

0.0

end end

I bet it messes up tracking view runtime amounts, but I don't care about that right now :)

There's a (seemingly related) ticket here http://datamapper.lighthouseapp.com/projects/20609-datamapper/ticke...

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Pages