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

Run tests with Rails default configuration to enable Zeitwerk #190

Merged
merged 1 commit into from
Dec 30, 2020

Conversation

bensheldon
Copy link
Owner

@bensheldon bensheldon commented Dec 30, 2020

GoodJob requires Rails use the Zeitwerk autoloader (not Classic) for Rails 6.0+.

This PR ensures that that the test environment defaults to the configuration defaults for the version of Rails the test suit is being run against.

This was discovered because of a deadlock caused by isolating a single test that loads up a bunch of Scheduler threads at once. I think it's the same deadlock that causes CI tests to flakily time-out:

$ RBTRACE=1 bin/rspec spec/integration/scheduler_spec.rb:52

it 'pops items off of the queue and runs them' do
max_threads = 5
performer = GoodJob::Performer.new(GoodJob::Job.all, :perform_with_advisory_lock)
scheduler = GoodJob::Scheduler.new(performer, max_threads: max_threads)
max_threads.times { scheduler.create_thread }

@bensheldon bensheldon merged commit 4c9a154 into main Dec 30, 2020
@bensheldon bensheldon deleted the zeitwerk branch December 30, 2020 19:36
@bensheldon bensheldon added the refactor Code changes that do not introduce new features label Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code changes that do not introduce new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant