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

Not compatible with Rails parallel testing with processes #217

Open
gchan opened this issue Mar 25, 2024 · 3 comments
Open

Not compatible with Rails parallel testing with processes #217

gchan opened this issue Mar 25, 2024 · 3 comments

Comments

@gchan
Copy link
Contributor

gchan commented Mar 25, 2024

We've received reports that the test collector is currently not compatible with Rails Parallel Testing with Processes.

There are two potential workarounds:

  • Use threaded mode (Rails Parallel Testing with Threads). However be aware this mode does not create multiple databases and will not work with system/integration tests.
  • Disable parallel testing by setting PARALLEL_WORKERS=0
@outerim
Copy link

outerim commented Oct 1, 2024

Any updates on this issue? I'm seeing something similar, currently using https://github.com/willbryant/parallel_rspec for test parallelization and not seeing any data except for limited circumstances where we retry tests without parallelization.

@zhming0
Copy link
Contributor

zhming0 commented Oct 8, 2024

hey @outerim, we investigated this issue and proposed a problem/solution:

Problem:

  • Test hooks runs per process in child process.
  • However, reporter seems to runs in parent process.
  • Reporter in this case is agnostic about what happens in test hooks, therefore have no data to send.
  • Reporter is where upload happened.
  • result in no data.

Solution:

The fix will need to change the communication pattern between reporter and test hook to be a IPC. We proposed to use SQLite as a cross-process central state.


However, sadly, we haven't prioritised this over other work we have going on. Pull requests are welcomed though!

As an alternative, you can choose to use our Test Engine Client, which can partition your test on pipeline job level.

@outerim
Copy link

outerim commented Oct 8, 2024

Thanks for looking into this. I ended up forking the test collector and tinkering with an implementation for parallel_rspec that has been working with one semi-notable exception. I've kind of kludged around multiple exception errors for right now as there seem to be some issues with the way that parallel_rspec handles those that may make reporting problematic.

If you want to peek at the implementation and see if the overall direction I've taken might be acceptable I could try and clean it up for a PR.

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

3 participants