# Rake test tasks only work with --trace

**URL:** <https://www.ruby-forum.com/t/rake-test-tasks-only-work-with-trace/106403>\
**Category:** Rails\
**Created:** [June 9, 2007, 10:14pm UTC](https://www.ruby-forum.com/t/rake-test-tasks-only-work-with-trace/106403 "2007-06-09T22:14:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmckible](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c4cdca/32.png) [@jmckible](https://www.ruby-forum.com/u/jmckible)\
**Post date:** [June 9, 2007, 10:14pm UTC](https://www.ruby-forum.com/t/rake-test-tasks-only-work-with-trace/106403/1 "2007-06-09T22:14:28Z")

</div>

So this has left me completely confused. I’m trying to get the test  
suite going on an existing app, but things going a little crazy.

In the application directory if I do ‘rake’ or ‘rake test’ I get:

rake aborted!  
Lost connection to MySQL server during query

However if I do ‘rake test:units’ or ‘rake test:functionals’ the tests  
run as expected.

Here’s where it gets screwy. In an attempt to figure out what’s going  
on, I did ‘rake --trace’ and it ran all the tests fine. However, ‘rake  
test --trace’ fails with an error I’ll post below.

It looks to me like the schema dump is running into problems. I just  
can’t figure out why it works for some tasks and not other. They all  
seem to go through the same db building process.

The app is running with Rails 1.2.2 frozen into vendor/rails.

Jordan  
[http://jordan.mckible.com](http://jordan.mckible.com)

/dev/myapp/config/…/vendor/rails/activerecord/lib/active\_record/vendor/mysql.rb:1127:in  
`write' /dev/myapp/config/../vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:1177:in `finalizer’  
/dev/myapp/config/…/vendor/rails/activerecord/lib/active\_record/connection\_adapters/abstract/schema\_definitions.rb:324:in  
`call' /dev/myapp/config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb:324:in `column’  
./db/schema.rb:96  
/dev/myapp/config/…/vendor/rails/activerecord/lib/active\_record/connection\_adapters/abstract/schema\_statements.rb:94:in  
`create_table' /dev/myapp/config/../vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:353:in `create\_table’  
/dev/myapp/config/…/vendor/rails/activerecord/lib/active\_record/migration.rb:275:in  
`send' /dev/myapp/config/../vendor/rails/activerecord/lib/active_record/migration.rb:275:in `method\_missing’  
/dev/myapp/config/…/vendor/rails/activerecord/lib/active\_record/migration.rb:259:in  
`say_with_time' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure’  
/dev/myapp/config/…/vendor/rails/activerecord/lib/active\_record/migration.rb:259:in  
`say_with_time' /dev/myapp/config/../vendor/rails/activerecord/lib/active_record/migration.rb:273:in `method\_missing’  
./db/schema.rb:92  
/dev/myapp/config/…/vendor/rails/activerecord/lib/active\_record/schema.rb:43:in  
`instance_eval' /dev/myapp/config/../vendor/rails/activerecord/lib/active_record/schema.rb:43:in `define’  
./db/schema.rb:5  
/dev/myapp/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_support/dependencies.rb:488:in  
`load' /dev/myapp/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:488:in `load’  
/dev/myapp/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' /dev/myapp/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:488:in `load’  
/dev/myapp/config/…/vendor/rails/railties/lib/tasks/databases.rake:31

---

<div class="post-metadata">

**Author:** ![jmckible](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c4cdca/32.png) [@jmckible](https://www.ruby-forum.com/u/jmckible)\
**Post date:** [June 10, 2007, 2:33am UTC](https://www.ruby-forum.com/t/rake-test-tasks-only-work-with-trace/106403/2 "2007-06-10T02:33:11Z")

</div>

I’ve run into the same problem a few times before and it always seems  
to have something to do with the mysql gem. If you have the mysql gem  
installed, try uninstalling it. If you don’t have it installed, try  
installing it but watch for errors during the install. I think the  
problem occurs when you attempt to install the mysql gem and the build  
fails.

Aaron
