Timeouts with ruby 1.9.1

I find myself in a confused spot. Please note I am running
OS X 10.5
ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-darwin9]
rspec 1.2.9
rspec-rails 1.2.9
TextMate Version 1.5.8 (1509)

I have a user model and a corresponding user_spec.rb.file. When I run
user_spec.rb in TextMate all examples pass. All the examples also pass
when I run ./script/spec spec/ and ./script/spec spec/models and
./script/spec/models/user_spec.rb. However when I run rake spec it
suddenly throws errors. Weird enough, when I run rake spec:models all
examples pass.

Under pinning all this weird behaviour (WBDD :p) is the timeouts that
crop up. Below is a stacktrace (that’s as far as it goes) of the
timeouts that crop up when I run rake spec.

‘User validation should require a name’ FAILED

expected “is required.”
got nil

(compared using eql?)

/Users/liseki/work/wwror/adify/spec/models/user_spec.rb:35:in block (2 levels) in <top (required)>' /opt/local/lib/ruby1.9/1.9.1/timeout.rb:44:intimeout’

A similar thing (timeouts) happens for some controllers as seen in the
trace below

ActiveRecord::RecordInvalid in ‘UserSessionsController attempting sign
in when already signed in should set flash notice and redirect to the
signed-in-user’s homepage’
Validation failed:
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/validations.rb:1090:in
save_with_validation!' /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/dirty.rb:87:insave_with_dirty!’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/transactions.rb:200:in
block (2 levels) in save_with_transactions!' /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:136:intransaction’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/transactions.rb:182:in
transaction' /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/transactions.rb:200:inblock in save_with_transactions!’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/transactions.rb:208:in
rollback_active_record_state!' /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/transactions.rb:200:insave_with_transactions!’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/notahat-machinist-1.0.3/lib/machinist/active_record.rb:54:in
make' /Users/liseki/work/wwror/adify/spec/support/authentication_helper.rb:3:insign_in’
/Users/liseki/work/wwror/adify/spec/controllers/user_sessions_controller_spec.rb:47:in
block (2 levels) in <top (required)>' /opt/local/lib/ruby1.9/1.9.1/timeout.rb:44:intimeout’

Any ideas would be appreciated. Thanks.

Sorry, actually those were not the full backtraces. Please see below:

Example 1

User validation should require a name’ FAILED

expected “is required.”
got nil

(compared using eql?)

/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/expectations/fail_with.rb:41:in
fail_with' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/expectations/handler.rb:21:inhandle_matcher’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/expectations/extensions/kernel.rb:27:in
should' /Users/liseki/work/wwror/adify/spec/models/user_spec.rb:35:inblock (2
levels) in <top (required)>’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_methods.rb:40:in
instance_eval' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_methods.rb:40:inblock in execute’
/opt/local/lib/ruby1.9/1.9.1/timeout.rb:44:in timeout' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_methods.rb:37:inexecute’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_group_methods.rb:214:in
block in run_examples' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_group_methods.rb:212:ineach’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_group_methods.rb:212:in
run_examples' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_group_methods.rb:103:inrun’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/example_group_runner.rb:23:in
block in run' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/example_group_runner.rb:22:ineach’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/example_group_runner.rb:22:in
run' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/options.rb:151:inrun_examples’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/command_line.rb:9:in
run' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/bin/spec:5:in

Example 2

ActiveRecord::RecordInvalid in ‘UserSessionsController attempting sign
in when already signed in should set flash notice and redirect to the
signed-in-user’s homepage’
Validation failed:
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/validations.rb:1090:in
save_with_validation!' /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/dirty.rb:87:insave_with_dirty!’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/transactions.rb:200:in
block (2 levels) in save_with_transactions!' /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:136:intransaction’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/transactions.rb:182:in
transaction' /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/transactions.rb:200:inblock in save_with_transactions!’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/transactions.rb:208:in
rollback_active_record_state!' /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.4/lib/active_record/transactions.rb:200:insave_with_transactions!’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/notahat-machinist-1.0.3/lib/machinist/active_record.rb:54:in
make' /Users/liseki/work/wwror/adify/spec/support/authentication_helper.rb:3:insign_in’
/Users/liseki/work/wwror/adify/spec/controllers/user_sessions_controller_spec.rb:47:in
block (2 levels) in <top (required)>' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_methods.rb:70:ininstance_eval’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_methods.rb:70:in
block in eval_each_fail_fast' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_methods.rb:70:ineach’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_methods.rb:70:in
eval_each_fail_fast' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_group_hierarchy.rb:17:inrun_before_each’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_methods.rb:103:in
run_before_each' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_methods.rb:124:inbefore_each_example’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_methods.rb:39:in
block in execute' /opt/local/lib/ruby1.9/1.9.1/timeout.rb:44:intimeout’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_methods.rb:37:in
execute' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_group_methods.rb:214:inblock in run_examples’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_group_methods.rb:212:in
each' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_group_methods.rb:212:inrun_examples’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/example/example_group_methods.rb:103:in
run' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/example_group_runner.rb:23:inblock in run’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/example_group_runner.rb:22:in
each' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/example_group_runner.rb:22:inrun’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/options.rb:151:in
run_examples' /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/command_line.rb:9:inrun’
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/bin/spec:5:in
`’

Thanks for any ideas.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs