|
@@ -3,6 +3,7 @@ package main
|
|
|
import (
|
|
|
"net"
|
|
|
"strings"
|
|
|
+ "sync"
|
|
|
"time"
|
|
|
|
|
|
"github.com/abh/geodns/Godeps/_workspace/src/github.com/miekg/dns"
|
|
@@ -208,6 +209,18 @@ func (s *ServeSuite) TestServingEDNS(c *C) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+func (s *ServeSuite) TestServeRace(c *C) {
|
|
|
+ wg := sync.WaitGroup{}
|
|
|
+ for i := 0; i < 5; i++ {
|
|
|
+ wg.Add(1)
|
|
|
+ go func() {
|
|
|
+ s.TestServing(c)
|
|
|
+ wg.Done()
|
|
|
+ }()
|
|
|
+ }
|
|
|
+ wg.Wait()
|
|
|
+}
|
|
|
+
|
|
|
func (s *ServeSuite) BenchmarkServing(c *C) {
|
|
|
for i := 0; i < c.N; i++ {
|
|
|
exchange(c, "_country.foo.pgeodns.", dns.TypeTXT)
|