Metadata Collection / Parallelization Leads to Time Out for RSpec

Not sure if I’m doing something wrong or others have encountered this, but in my Rails app’s Gemfile, I have:

gem 'rspec_junit_formatter'

And then in circle.yml, I have:

    - bundle exec rspec --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec.xml:
        parallel: true
          - spec/**/*_spec.rb

This was taken from this documentation here.

We have tests split across three containers, and each of them appears to be running commands like:

bundle exec rspec --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec.xml 'spec/models/something_spec.rb' 'spec/models/something_else_spec.rb'

Two of the three containers succeed completely; one in about 3m30s and the other in about 7m30s. However, the last container times out at 10m10s with the following error printed to the console:

command bundle exec rspec --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec.xml took more than 10 minutes since last output

What’s the best way to handle this? It seems like maybe the issue is that Circle is expecting SOME kind of console output, but it’s being directed and used elsewhere for metadata collection. Should I just increase the time-out limit so that this operation can complete the first time and then the tests will be balanced and likely complete beneath the 10m limit anyway? Should I change the output option? For either of these (or others), what’s the best way to go about implementing it?

Thanks for any suggestions or advice!

Hello @conwayje,

Thank you for your report!

It seems you’ve stumbled upon a documentation :bug:!

In order to avoid hitting the 10 minute no-output limit, you need to add the “progress” formatter to the rspec command, such as bundle exec rspec --format progress --format RspecJunitFormatter ...

I’ve went ahead and wrote a patch to our docs to avoid hitting this in the future:

Much appreciated!!!

1 Like

Great! Works for me. Thank you! :grinning:

1 Like