-
Notifications
You must be signed in to change notification settings - Fork 115
Tests run fine on sauce until we enable parallelization #337
Comments
Have you tried running in parallel by using the Rake task?
|
parallelization is performed using parallel_tests which runs one process per file. |
@bootstraponline we're using rspec with a spec_helper. We aren't using a Rakefile. Any help on why we'd use that? |
It would be interesting to know if it worked via Rakefile or if the error remained the same. |
Ah I see. Ok, I assume the details are on the page about setting up the Rakefile. Our QA Engineer just always ran rspec :-) -- I'll get back to you |
I have an example repo.
|
The Sauce gem patches parallal_test's test division like so:
By doing tests in parallel in this manner, we have a greater chance of evening out test time. The default Sauce gem running pattern, that of running each test sequentially against each browser, doesn't parallelise as well; A long running test will run on every browser in turn in the same thread, potentially taking significantly longer then every other thread. Additionally, in instances where there is more available concurrency then tests, there's no way to use higher concurrency. Unfortunately, running in this test-distributing fashion requires us to do some funky stuff to load the required test config before a test run, hence relying on a It'd be possible to fix this, I guess, by setting an environment variable when the rake task runs, telling child tasks that they're running from the Sauce specific integration; If we were to do that, however, I'd still want to issue a message saying that parallelism of that kind isn't always as efficient. |
parallel_tests uses processes to run in parallel not threads (even though it waits for them to finish via threads). In the ideal situation, it'd be per test and not per file via parallel_split_test. Manually breaking large test files down into smaller files for better performance isn't fun. |
@bootstraponline How do I make the Rakefile only run tests within a certain folder? We've got 2 old ones and a new one that we run and running |
The tests get kicked off on Saucelabs by running So: same issue as above.
|
@lanceblais The sauce:spec rake task accepts options.
Try passing the target folder as the |
I was only able to give it one file at a time (unless there's some way to do regex) by running: When I run this command I get exactly the same output as I did when running with So to answer your question: Sorry for the delay, now what? |
I recommend creating a reduced test case that reproduces the issue and uploading it to github. The example I have on GitHub is working fine so I think there's something unique about your configuration. |
Hello,
We're using RSpec and SauceLabs to run our Selenium tests.
We've followed all the information on the Wiki and we're able to run
bundle exec rspec spec/path/to/e2e
.When we enable parallelization and run
bundle exec parallel_rspec spec/path/to/e2e
we get this error:Note: launch_cms_homepage() is a method defined in one of the helpers we pull in.
Has this been seen before?
A related question, what strategy does the parallelization take for a folder of specs?
The
e2e
folder hase2e/1/test1.rb
which has a bunch of describe blocks ande2e/1/test2.rb
also has a bunch of specs. Is the parallelization at the describe block level, the file level, or other?Thank you!
The text was updated successfully, but these errors were encountered: