Skip to content
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

Don't run rubocop in parallel with the Rake task #475

Merged
merged 1 commit into from Aug 25, 2021

Conversation

etiennebarrie
Copy link
Member

When I run bundle exec rake the tests fail, and it has been happening since #470.
It comes from rubocop/rubocop#10000.
Parallelization causes issues with the way Rails runs tests see rails/rails#41132, since Rails uses at_exit, and Rubocop creates multiple forks, all of them start running the tests, and database locking occurs.

We could also fix that by moving the Rubocop task first, since the at_exit hooks wouldn't have been defined at this point, but I like to keep it at the end, and it's not that slow anyway. It could also be fixed by Rubocop not running its code directly from the Rake task, but in a subprocess, which would not bring along the at_exit hooks.

@etiennebarrie etiennebarrie merged commit 1b6a682 into main Aug 25, 2021
@etiennebarrie etiennebarrie deleted the rubocop-no-parallel branch August 25, 2021 12:36
lawrencewong pushed a commit to lawrencewong/maintenance_tasks that referenced this pull request Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants