Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Fixture ID and String#hash in 1.9.1

#2125

An example from my terminal:

Terminal output

It seems like the output of String#hash varies from process to process. This means that the ID that the foxy fixtures generates (which uses String#hash on the fixture key name) are only dependable per test run, not across multiple runs.

I wish I could provide a patch or suggest a solution, but after some sparse investigation I haven't found anything about changes to String#hash in 1.9.1.

This is only a problem when you refer to the IDs generated by the foxy fixtures, which you rarely do anyways. I discovered this in an app where I refer to some IDs in a config/settings.yml, and because I use fixture data via rake db:fixtures:load when developing, refering to these IDs are not reliable on 1.9 because they will change the next time I run rake db:fixtures:load.

Reported by August Lilleaas · March 4th, 2009 @ 01:44 PM

State: invalid
Milestone: 3.x
Assigned to: nobody
Importance: Low

Activity

  1. August Lilleaas
    August Lilleaas

    Take a look at this pastie:

    http://pastie.org/407108

    As you can see, the implementation of String#hash has changed significantly since 1.8, and is indeed different in every process, because of the random number seeding that occurs in rb_memhash.

    March 4th, 2009 @ 02:12 PM

  2. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  3. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to invalid
    • Importance changed from to Low

    October 7th, 2010 @ 07:20 AM