-
Notifications
You must be signed in to change notification settings - Fork 23
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
Flaky behavior in Minitest with callbacks and ActiveJob #19
Comments
That is super weird! Have never heard about such nasty behavior. It would be awesome if you could make reproducible test case, e.g. as a gist using ActiveRecord's bug report template: https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_gem.rb |
Also, your code can be simplified.
Maybe any of this will eliminate your test flakiness to go away |
@Envek Thanks for the feedback. I've made those changes and I'll closely watch our CI/CD for the next few days and report back. |
Before anything else, I want to say thank you for this gem. It is awesome and very helpful in our code base.
Currently, I'm running into some flaky test behavior that I have narrowed down to this gem.
Use case: We have an ActiveRecord class for which do a 1:1 sync to an external service. Whenever we destroy a record, we want to enqueue a job to remove it from an external service.
To enable this method, we have the following:
We test this behavior in a really simple way:
Nine out of ten times, this spec passes. However, on the random outlier, we get the following:
How I am really scratching my head. I suspect this has something to do with how
rails test
manages transaction.Have you ever seen something like this before? Any idea on what might be causing it?
Thank you in advance for any guidance! And thank you again for this gem. Happy to contribute to a fix in anyway.
The text was updated successfully, but these errors were encountered: