Richard Searle

home

Parallel tests in sbt and specs

16 Oct 2011

Both specs and sbt 0.11 by default run tests in parallel. In general, this is a good idea. It utilizes the resources of modern multicore systems and helps to flush out inadvertent multithreading defects. It is a really bad idea when the tests were not written to be thread safe! Two separate and a little obscure configuration changes are required. In the build.sbt add:
parallelExecution in Test := false
With in the specification, add a sequential entry. For example:
class Test extends Specification {
   sequential