Source

go-wise / parallel_test.go

Full commit
// Small example on how to run tests in parallel
// To run the tests, execute "gotest --parallel 10 -v"
//
// Note that you need to have go version > weekly.2011-10-06

package parallel

import (
	"testing"
	"time"
)

func TestOne(t *testing.T) {
	t.Parallel()
	time.Sleep(2 * 1e9)
}

func TestTwo(t *testing.T) {
	t.Parallel()
	time.Sleep(2 * 1e9)
}

// This test is not parallel, it will run before the previous two
func TestThree(t *testing.T) {
	t.Fatal("OUCH")
}