# Funny behavior with Fixtures... on Ubuntu..

**URL:** <https://discuss.rubyonrails.org/t/funny-behavior-with-fixtures-on-ubuntu/24824>\
**Category:** rubyonrails-core\
**Created:** [February 12, 2008, 10:38pm UTC](https://discuss.rubyonrails.org/t/funny-behavior-with-fixtures-on-ubuntu/24824 "2008-02-12T22:38:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Simonov](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Alexander\_Simonov](https://discuss.rubyonrails.org/u/Alexander_Simonov)\
**Post date:** [February 12, 2008, 10:38pm UTC](https://discuss.rubyonrails.org/t/funny-behavior-with-fixtures-on-ubuntu/24824/1 "2008-02-12T22:38:04Z")

</div>

Hey Guys,

I've got a test class that loads a bunch of fixtures. My understanding is that fixtures are reloaded between each test... and I even have the following two method calls at the top of my test class to make doubly sure...

class TaskTest \< Test::Unit::TestCase

&nbsp;&nbsp;self.use\_transactional\_fixtures = true &nbsp;&nbsp;self.use\_instantiated\_fixtures = false

When I run my tests individually... as in:

ruby unit/task\_test.rb --name test\_update

The tests run successfully to completion. However, when I try to run the entire test file in one go, I get failures. As in:

ruby unit/task\_test.rb

> &nbsp;&nbsp;8) Error: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;test\_update(TaskTest): &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ActiveRecord::RecordNotFound: Couldn't find Task with ID=2

I query the database and the record task.id = 2 is indeed missing. Strangely enough this test file works perfectly on Windows.

Anyone have any ideas? I'm guessing there's an issue with my Linux/Ubuntu mysql adapter... but I'm not sure how to confirm... Any help would be very much appreciated.

Sonny.

---

<div class="post-metadata">

**Author:** ![Matt\_Palmer](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@Matt\_Palmer](https://discuss.rubyonrails.org/u/Matt_Palmer)\
**Post date:** [February 13, 2008, 2:47am UTC](https://discuss.rubyonrails.org/t/funny-behavior-with-fixtures-on-ubuntu/24824/2 "2008-02-13T02:47:55Z")

</div>

I can't give you any help, unfortunately, except to note that I've observed similar failures on my system, which is Ubuntu also. I haven't had a chance to chase down WTF is going on, though, and I doubt I'll be in much of a position to do so in the near future. But at least you know you're not alone now. \<grin\>

- Matt

---

<div class="post-metadata">

**Author:** ![Rick\_DeNatale](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@Rick\_DeNatale](https://discuss.rubyonrails.org/u/Rick_DeNatale)\
**Post date:** [February 13, 2008, 12:35pm UTC](https://discuss.rubyonrails.org/t/funny-behavior-with-fixtures-on-ubuntu/24824/3 "2008-02-13T12:35:04Z")

</div>

This topic is probably better discussed on the general rails-talk forum rather than core, but

One thought is to check that you are using a mysql table type which supports transactions. Innodb does, myisam (which is or used to be the default for mysql) does not.

Try setting use\_transactional\_fixtures to fall and see if it makes a difference.

---

<div class="post-metadata">

**Author:** ![Rick\_DeNatale](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@Rick\_DeNatale](https://discuss.rubyonrails.org/u/Rick_DeNatale)\
**Post date:** [February 13, 2008, 12:35pm UTC](https://discuss.rubyonrails.org/t/funny-behavior-with-fixtures-on-ubuntu/24824/4 "2008-02-13T12:35:43Z")

</div>

s/fall/false/

---

<div class="post-metadata">

**Author:** ![Alexander\_Simonov](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Alexander\_Simonov](https://discuss.rubyonrails.org/u/Alexander_Simonov)\
**Post date:** [February 13, 2008, 5:33pm UTC](https://discuss.rubyonrails.org/t/funny-behavior-with-fixtures-on-ubuntu/24824/5 "2008-02-13T17:33:59Z")

</div>

Rick Denatale wrote:

> One thought is to check that you are using a mysql table type which supports transactions. Innodb does, myisam (which is or used to be the default for mysql) does not.

Awesome, that did the trick. It appears the Debian/Ubuntu release for mySQL 5 has the table type default to myIsam.

Sonny.
