Autotest/RSpec 1.1.4/Rails 2.1 Infinite Loop?

I just got back from RailsConf, and upgraded on of my development apps
to 2.1, and now autotest is going into an infinite loop. It runs tests
continuously instead of waiting for files to be saved before rerunning.

Has anybody else seen this, or know how to get around it?

Thanks,

Andrew

Had this a few times - seems to be something to do with the .autotest
file
in your home folder, replacing that has helped me before, but I can’t be
more specific.

2008/6/3 Andrew S. [email protected]:

I just got back from RailsConf, and upgraded on of my development apps to
2.1, and now autotest is going into an infinite loop. It runs tests
continuously instead of waiting for files to be saved before rerunning.

Has anybody else seen this, or know how to get around it?

I had this or a similar problem.

I tracked it down to sometimes requiring spec_helper with expand_path,
and other times with just the relative path. So, spec_helper was
getting included twice in some cases, resulting in errors on the full
suite. The loop that I usually hit was that it would bounce from the
failures in the full spec, to run the individual failing spec file,
which was green since spec_helper was only required once, and so would
run the full spec, and again and again and again.

Sometimes even when the full spec was green, it would re-run itself. I
didn’t figure out exactly why it happened in that case since fixing
all the require paths to match solved that too.

On Thu, Jun 19, 2008 at 9:41 AM, Jim L. [email protected]
wrote:

getting included twice in some cases, resulting in errors on the full
suite. The loop that I usually hit was that it would bounce from the
failures in the full spec, to run the individual failing spec file,
which was green since spec_helper was only required once, and so would
run the full spec, and again and again and again.

Sometimes even when the full spec was green, it would re-run itself. I
didn’t figure out exactly why it happened in that case since fixing
all the require paths to match solved that too.

The typical cause of these infinite loops is that your test suite
updates some file in your project; autotest notices the change and
immediately starts again.

The solution is to simply add exceptions to your project’s .autotest,
ignoring any files generated/touched by your test runs.

k

On Thu, Jun 19, 2008 at 12:32 PM, Lori M Olson [email protected]
wrote:

Would you have an example of such an exception to share?

Thanks, Lori

The .autotest at the base of one of my plugins, which updates a
.sqlite3:

Autotest.add_hook :initialize do |at|
at.add_exception(‘spec/db/tracks_history.sqlite3’)
end

And that’s all there is to do. I should’ve mentioned in my last email
that you can use autotest -v to figure out what files autotest has
not yet been set up to ignore.

k

On 19-Jun-08, at 9:10 AM, Kyle H. wrote:

[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Would you have an example of such an exception to share?

Thanks, Lori