-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling self.save in an ActiveRecord after_update callback causes a crash #316
Comments
Thanks @cjeffries - could you setup a simple repo reproducing the problem? I want to be sure I actually fix the problem and it's not something else (it looks like RSpec is producing some unexpected output because of the crash). |
In my case same story ended by manual run command from |
@e2 I've also stumped on this issue. I don't know the ins-and-outs of guard-spec but How about in runner.rb at |
@leods92 - "success == false" can't be used there, because "success" here means it was possible to run RSpec - even though tests failed (as opposed to not being able to run RSpec). It seems like RSpec is failing because of failing tests - and that's fine. What's wrong is that the RSpec output doesn't seem to be handled properly (the summary). Could you create a repository recreating the same error? The Basically, the formatter output file is "strange" in some way - and this should be handled properly (I just need to know how to reproduce the same problem, and I can take it from there). |
@e2 The error seems to be random. Sometimes if I run the specs twice very fast it happens, for instance. I'm afraid that therefore I couldn't provide a repo. I monkey patched the gem though and logged the There's some agglutination going on in the output. How about replacing We should probably tackle this output agglutination thing, do you have any ideas about it? |
@leods92 - I'll need to reproduce the error no matter what, even if it's just to add a unit test. If it's random, it may be that the specs are run in a random order - you can set the RSpec seed to a fixed number. Other than that, in the
That should help bring about the actual error and we can investigate from there. |
@e2 Thanks for your tips! :) I haven’t been able to reproduce the error again though. I’m not developing that intensively in the last few days anyway. I removed those blocks and I’ll let you know about how it goes if I get any error message.
|
@e2 Here's the error:
I'll be investigating it and I'll try to send you an error reproduction. Anyway, that seems to happen pretty randomly: sometimes when running a specific spec file, or multiple, sometimes at the beginning of specs (even before outputting anything), sometimes at the end. |
@leods92 - that explains things a bit. Are you using lines = File.readlines(formatter_tmp_file) into: lines = File.readlines(File.expand_path(formatter_tmp_file)) Also in (All such rescue methods should be removed everywhere - I'll check them once we get close to fixing this issue). |
I'm closing this since I've reworked handling results files (v4.5.2), so please report any crashes as new issues (they'll be different). Thanks! |
For example:
with rspec and FactoryGirl spec:
with exception:
This is dumb logic on the model because of the infinite loop, but figured it'd be worthwhile mentioning it as an issue.
The text was updated successfully, but these errors were encountered: