Post-test commands that run on every container?



We need a way to specify a post-test command that runs on EVERY container, instead of just the first one - alternatively, if we could access the list of spec files that CircleCI inferred is supposed to run on that particular node (which makes use of junit-rspec-formatter timings), that would also work for our purposes. OR if there was a test command that we could run on each container after any inferred test commands.

Is either of this possible?

Our use-case is that we want to perform retries of failed specs for a particular container after the main run, in a new separate process, so as to have as fresh an environment as possible. This is almost possible by overriding Rspec’s --failure-exit-code for the first run, BUT we run into the issue where we can only rerun the failed specs for the first container, due to how CCI’s post-test command works.

We also want to keep taking advantage of CCI’s inferred-runtime-balanced spec distribution, hence are refraining from overriding the inferred test command.


Shouldn’t you be able to set parallel: true for the command to run on all containers?


FYI the parallel option is not available for the post section - only the override section.


This would be a useful feature. Is there a feature request open? Can someone from CircleCI please comment here?

If there’s a reason why the feature cannot be implemented, the documentation at should explicitly mention this.