Skip to content

Use different indexes when executing parallel tests in rails 6 #1013

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

Closed
jonnynux opened this issue Nov 10, 2021 · 1 comment
Closed

Use different indexes when executing parallel tests in rails 6 #1013

jonnynux opened this issue Nov 10, 2021 · 1 comment

Comments

@jonnynux
Copy link

Is it possible to use different indexes name for different testing executor when running rails 6 tests in parallel?

Thanks.

@jonnynux
Copy link
Author

I answer on myself:

class ActiveSupport::TestCase
  # Run tests in parallel with specified workers
  parallelize(workers: :number_of_processors)

  parallelize_setup do |n|
    Model.index_name "model_test-#{n}"
    Model.create_index if !Ioc.index_exists
  end
end

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

No branches or pull requests

1 participant