Skip to content

Add parallelization support.#207

Open
rolftimmermans wants to merge 5 commits into
TalentBox:masterfrom
rolftimmermans:parallelization
Open

Add parallelization support.#207
rolftimmermans wants to merge 5 commits into
TalentBox:masterfrom
rolftimmermans:parallelization

Conversation

@rolftimmermans

@rolftimmermans rolftimmermans commented Jun 6, 2026

Copy link
Copy Markdown

This supports running tests in parallel, cutting down test time drastically on larger test suites.

class ActiveSupport::TestCase
  parallelize(workers: :number_of_processors)
  # ...
end

I tested this with a nontrivial Rails app that uses PostgreSQL, with various Sequel plugins and extensions.

For pg it clones the main test database with the template option to ensure the worker copies are 100% identical, including OIDs.

For other db adapters the structure is loaded. I do not have a good app to test; it may or may not work well.

Ensuring that the model's db objects are correct after forking seems nontrivial. Ideally there is more support from sequel itself to do this in a robust way. If this PR is accepted I will pursue this.

Feedback is very welcome. I'm eager to get this merged if possible :)

@JonathanTron

Copy link
Copy Markdown
Member

Hi @rolftimmermans thanks for the PR !

The changes so far look fine, with minimal impact on non-related code.

I'm not sure how yet, but we need to add tests around the feature.

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.

2 participants