Friday, October 7, 2011

Running Tests In Parallel

As of weekly.2011-10-06, parallel testing is here. In order to have you test run in parallel, add a call to t.Parallel() at the top of your test function. Then run gotest with --parallel N (where N > 1).

Things to notice:
  • A parallel test run in parallel only to other parallel tests. That means your non-parallel tests will run first and then your parallel ones.
  • A maximum of --parallel (a new gotest command line switch) tests will run in parallel. --parallel defaults to runtime.GOMAXPROCS(0) which is 1. This means the if you don't specify --parallel, your parallel tests will run one at a time.

No comments:

Post a Comment

/* MIKI: Analytics */