[rspec-users] Autotest/RSpec 1.1.4/Rails 2.1 Infinite Loop?
philodespotos at gmail.com
Thu Jun 19 11:10:09 EDT 2008
On Thu, Jun 19, 2008 at 9:41 AM, Jim Lindley <jimlindley at gmail.com> wrote:
>>> 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.
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.
More information about the rspec-users