Andrew Selder
2008-Jun-03 14:08 UTC
[rspec-users] 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
rfwatson
2008-Jun-03 20:12 UTC
[rspec-users] Autotest/RSpec 1.1.4/Rails 2.1 Infinite Loop?
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 Selder <aselder at mac.com>:> 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 > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080603/7cb84697/attachment.html>
Jim Lindley
2008-Jun-19 14:41 UTC
[rspec-users] 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?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.
Kyle Hargraves
2008-Jun-19 15:10 UTC
[rspec-users] Autotest/RSpec 1.1.4/Rails 2.1 Infinite Loop?
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. k
Lori M Olson
2008-Jun-19 17:32 UTC
[rspec-users] Autotest/RSpec 1.1.4/Rails 2.1 Infinite Loop?
On 19-Jun-08, at 9:10 AM, Kyle Hargraves wrote:> 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 > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-usersWould you have an example of such an exception to share? Thanks, Lori
Kyle Hargraves
2008-Jun-19 21:52 UTC
[rspec-users] Autotest/RSpec 1.1.4/Rails 2.1 Infinite Loop?
On Thu, Jun 19, 2008 at 12:32 PM, Lori M Olson <loriolson at mac.com> wrote:> Would you have an example of such an exception to share? > > Thanks, LoriThe .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