Matthew Lins
2007-Dec-04 20:43 UTC
[rspec-users] AutoTest / Rspec - "stack level too deep"
Hello, I''m running AutoTest with Rspec on a Rails application. Every 20 or so runs I get "stack level too deep" on one particular controller stub. Ex. controller.stub!(:login).and_return(true) This particular line is in a before block of a certain describe block. The strange thing is, every single spec in this file fails on that one line, even the specs in other describe blocks! Just for the hell of it, I commented it out. Then it fails on another controller stub in another describe block. Same behavior, every spec fails on this one line. I continue commenting the lines that are causing problems. I noticed it only happens with controller stubs and mocks. Once I finally get all controller mocks and stubs commented out, then my spec fails for legitimate reasons (because of the missing stubs). The only way I can fix this, is to reset AutoTest. Any ideas? Thanks, Matt P.S. If you really need to see this 750 line spec file, I''d be glad to pastie it, but I don''t think it''ll reveal anything.
Shane Mingins
2007-Dec-04 20:53 UTC
[rspec-users] AutoTest / Rspec - "stack level too deep"
On 5/12/2007, at 9:43 AM, Matthew Lins wrote:> Hello, > > I''m running AutoTest with Rspec on a Rails application. > > Every 20 or so runs I get "stack level too deep" on one particular > controller stub. > >So this spec fails when you just run it?? I was a little unsure if you are having a problem with autotest or with your spec ... it seemed the later? Cheers Shane
Matthew Lins
2007-Dec-05 15:37 UTC
[rspec-users] AutoTest / Rspec - "stack level too deep"
On 12/4/07 2:53 PM, "Shane Mingins" <smingins at elctech.com> wrote:> On 5/12/2007, at 9:43 AM, Matthew Lins wrote: > >> Hello, >> >> I''m running AutoTest with Rspec on a Rails application. >> >> Every 20 or so runs I get "stack level too deep" on one particular >> controller stub. >> >> > > > > So this spec fails when you just run it?? I was a little unsure if > you are having a problem with autotest or with your spec ... it > seemed the later?No I think its a combination of Autotest and Rspec. Let me summarize: - I have Autotest running constantly with Rspec on a Rails app - When I start Autotest it''ll run all my tests, ALL PASS - After making changes to code, Autotest detects such and runs the tests again for the specific file I''m editing ( a controller in this case) - After about 10-20 changes(Autotest runs the specs each time), I get a bunch of errors ("stack level too deep") on my controller mocks and stubs. The only way I can cure this, is by restarting AutoTest. Then in 10-20 more changes it''ll happen again. It''s very frustrating. If anyone can even give me a clue, I''d be very grateful. Let me know if I can provide any more information, sorry if I''m doing a poor job of explaining the problem. Thanks, Matt> > Cheers > Shane > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
Scott Taylor
2007-Dec-05 15:48 UTC
[rspec-users] AutoTest / Rspec - "stack level too deep"
On Dec 5, 2007, at 10:37 AM, Matthew Lins wrote:> On 12/4/07 2:53 PM, "Shane Mingins" <smingins at elctech.com> wrote: > >> On 5/12/2007, at 9:43 AM, Matthew Lins wrote: >> >>> Hello, >>> >>> I''m running AutoTest with Rspec on a Rails application. >>> >>> Every 20 or so runs I get "stack level too deep" on one particular >>> controller stub. >>> >>> >> >> >> >> So this spec fails when you just run it?? I was a little unsure if >> you are having a problem with autotest or with your spec ... it >> seemed the later? > > No I think its a combination of Autotest and Rspec. > > Let me summarize: > > - I have Autotest running constantly with Rspec on a Rails app > > - When I start Autotest it''ll run all my tests, ALL PASS > > - After making changes to code, Autotest detects such and runs the > tests > again for the specific file I''m editing ( a controller in this case) > > - After about 10-20 changes(Autotest runs the specs each time), I > get a > bunch of errors ("stack level too deep") on my controller mocks > and stubs. > > The only way I can cure this, is by restarting AutoTest. Then in > 10-20 more > changes it''ll happen again. > > It''s very frustrating. > > If anyone can even give me a clue, I''d be very grateful. > > Let me know if I can provide any more information, sorry if I''m > doing a poor > job of explaining the problem. > > Thanks, > > MattIt would probably be helpful to see the stack trace. Scott
Lance Carlson
2007-Dec-05 15:54 UTC
[rspec-users] AutoTest / Rspec - "stack level too deep"
Pasting more of your code would help. I get this error when infinite recursion creeps into the application, or in my specs.. like when you run .save! on a model that has an after_filter calling save! On Dec 5, 2007 10:37 AM, Matthew Lins <mlins at webinforem.com> wrote:> On 12/4/07 2:53 PM, "Shane Mingins" <smingins at elctech.com> wrote: > > > On 5/12/2007, at 9:43 AM, Matthew Lins wrote: > > > >> Hello, > >> > >> I''m running AutoTest with Rspec on a Rails application. > >> > >> Every 20 or so runs I get "stack level too deep" on one particular > >> controller stub. > >> > >> > > > > > > > > So this spec fails when you just run it?? I was a little unsure if > > you are having a problem with autotest or with your spec ... it > > seemed the later? > > No I think its a combination of Autotest and Rspec. > > Let me summarize: > > - I have Autotest running constantly with Rspec on a Rails app > > - When I start Autotest it''ll run all my tests, ALL PASS > > - After making changes to code, Autotest detects such and runs the tests > again for the specific file I''m editing ( a controller in this case) > > - After about 10-20 changes(Autotest runs the specs each time), I get a > bunch of errors ("stack level too deep") on my controller mocks and stubs. > > The only way I can cure this, is by restarting AutoTest. Then in 10-20 more > changes it''ll happen again. > > It''s very frustrating. > > If anyone can even give me a clue, I''d be very grateful. > > Let me know if I can provide any more information, sorry if I''m doing a poor > job of explaining the problem. > > Thanks, > > Matt > > > > > > Cheers > > Shane > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >