diff options
author | 2017-01-12 08:13:50 +0000 | |
---|---|---|
committer | 2017-01-12 08:13:50 +0000 | |
commit | 94c59da57783c04426833dfcfa085f3ea304a1db (patch) | |
tree | 921de757789e423e547ebfa1905cdd361b203c15 /test/server.go | |
parent | 0c3ad499d87b4ee4e43a49ac8c8102e6369d7e19 (diff) | |
download | coredns-94c59da57783c04426833dfcfa085f3ea304a1db.tar.gz coredns-94c59da57783c04426833dfcfa085f3ea304a1db.tar.zst coredns-94c59da57783c04426833dfcfa085f3ea304a1db.zip |
Run tests in parallel (#478)
Create a small speedup running the tests:
PASS
ok github.com/miekg/coredns/test 10.329s
PASS
ok github.com/miekg/coredns/test 6.079s
Skip the etcd ones. Doing the middleware/*/*_test ones doesn't yield
any speedup as these are still done on a per directory basis.
Diffstat (limited to 'test/server.go')
-rw-r--r-- | test/server.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/server.go b/test/server.go index d472cc7d0..b290d5a22 100644 --- a/test/server.go +++ b/test/server.go @@ -3,6 +3,7 @@ package test import ( "io/ioutil" "log" + "sync" "github.com/miekg/coredns/core/dnsserver" @@ -12,8 +13,12 @@ import ( "github.com/mholt/caddy" ) +var mu sync.Mutex + // CoreDNSServer returns a CoreDNS test server. It just takes a normal Corefile as input. func CoreDNSServer(corefile string) (*caddy.Instance, error) { + mu.Lock() + defer mu.Unlock() caddy.Quiet = true dnsserver.Quiet = true log.SetOutput(ioutil.Discard) |