How to disable test parallelization *just* for system tests?

I’m finding that the default test parallelization makes chromedriver tests highly unreliable. But I’d like to keep other tests parallel.

I’ve tried this in application_system_test_case.rb:

class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
  parallelize(workers: 1)
  # ...

…but it doesn’t seem to override the default.


I have the same problems with reliability of the parallel system tests. When on CI and using different nodes could be done with setting PARALLEL_WORKERS env variable.

1 Like

Yeah, I’m using that env var manually right now, but I’d love to find a way to capture this guideline into the project’s defaults.

Interestingly this is not just a Rails problem. When I was playing with writing a web scraper in Rust a while back, Rust’s test parallelization caused ALLLLLLLL kinds of failures. The root cause there was that the chromedriver process was a contended resource between threads.

I’m really curious about what mechanisms Eileen (?) has put in place here to make this work to even the degree it does. I found it to be a difficult enough problem in Rust, and Rust has a lot more affordances for getting control over parallelization issues than Ruby does.