aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/auto_test.go12
-rw-r--r--test/file_reload_test.go4
-rw-r--r--test/file_xfr_test.go4
-rw-r--r--test/proxy_health_test.go5
-rw-r--r--test/reload_test.go3
5 files changed, 14 insertions, 14 deletions
diff --git a/test/auto_test.go b/test/auto_test.go
index 03b290ef8..f7502172f 100644
--- a/test/auto_test.go
+++ b/test/auto_test.go
@@ -21,7 +21,7 @@ func TestAuto(t *testing.T) {
corefile := `org:0 {
auto {
directory ` + tmpdir + ` db\.(.*) {1}
- reload 0.1s
+ reload 0.01s
}
}`
@@ -46,7 +46,7 @@ func TestAuto(t *testing.T) {
t.Fatal(err)
}
- time.Sleep(150 * time.Millisecond) // wait for it to be picked up
+ time.Sleep(10 * time.Millisecond) // wait for it to be picked up
resp, err = dns.Exchange(m, udp)
if err != nil {
@@ -59,7 +59,7 @@ func TestAuto(t *testing.T) {
// Remove db.example.org again.
os.Remove(filepath.Join(tmpdir, "db.example.org"))
- time.Sleep(150 * time.Millisecond) // wait for it to be picked up
+ time.Sleep(10 * time.Millisecond) // wait for it to be picked up
resp, err = dns.Exchange(m, udp)
if err != nil {
t.Fatal("Expected to receive reply, but didn't")
@@ -80,7 +80,7 @@ func TestAutoNonExistentZone(t *testing.T) {
corefile := `.:0 {
auto {
directory ` + tmpdir + ` (.*) {1}
- reload 1s
+ reload 0.01s
}
errors stdout
}`
@@ -119,7 +119,7 @@ func TestAutoAXFR(t *testing.T) {
corefile := `org:0 {
auto {
directory ` + tmpdir + ` db\.(.*) {1}
- reload 0.1s
+ reload 0.01s
}
transfer {
to *
@@ -142,7 +142,7 @@ func TestAutoAXFR(t *testing.T) {
t.Fatal(err)
}
- time.Sleep(150 * time.Millisecond) // wait for it to be picked up
+ time.Sleep(10 * time.Millisecond) // wait for it to be picked up
tr := new(dns.Transfer)
m := new(dns.Msg)
diff --git a/test/file_reload_test.go b/test/file_reload_test.go
index 163a8be3f..95cc860bb 100644
--- a/test/file_reload_test.go
+++ b/test/file_reload_test.go
@@ -21,7 +21,7 @@ func TestZoneReload(t *testing.T) {
corefile := `
example.org:0 {
file ` + name + ` {
- reload 0.1s
+ reload 0.01s
}
}
example.net:0 {
@@ -47,7 +47,7 @@ func TestZoneReload(t *testing.T) {
// Remove RR from the Apex
ioutil.WriteFile(name, []byte(exampleOrgUpdated), 0644)
- time.Sleep(150 * time.Millisecond) // reload time
+ time.Sleep(10 * time.Millisecond) // reload time
resp, err = dns.Exchange(m, udp)
if err != nil {
diff --git a/test/file_xfr_test.go b/test/file_xfr_test.go
index 0298f5e68..5597c826a 100644
--- a/test/file_xfr_test.go
+++ b/test/file_xfr_test.go
@@ -12,9 +12,9 @@ import (
)
func TestLargeAXFR(t *testing.T) {
- // Build a large zone in text format. It contains 64K AAAA RRs.
+ // Build a zone in text format. It contains 6.4K AAAA RRs. (this number is rather random)
var sb strings.Builder
- const numAAAAs = 65536
+ const numAAAAs = 6553
sb.WriteString("example.com. IN SOA . . 1 60 60 60 60\n")
sb.WriteString("example.com. IN NS ns.example.\n")
for i := 0; i < numAAAAs; i++ {
diff --git a/test/proxy_health_test.go b/test/proxy_health_test.go
index 018ecd4ac..877af2882 100644
--- a/test/proxy_health_test.go
+++ b/test/proxy_health_test.go
@@ -2,6 +2,7 @@ package test
import (
"testing"
+ "time"
"github.com/miekg/dns"
)
@@ -61,9 +62,11 @@ func TestProxyThreeWay(t *testing.T) {
m := new(dns.Msg)
m.SetQuestion("example.org.", dns.TypeA)
+ c := new(dns.Client)
+ c.Timeout = 10 * time.Millisecond
for i := 0; i < 10; i++ {
- r, err := dns.Exchange(m, addr)
+ r, _, err := c.Exchange(m, addr)
if err != nil {
continue
}
diff --git a/test/reload_test.go b/test/reload_test.go
index 45f961298..2880011aa 100644
--- a/test/reload_test.go
+++ b/test/reload_test.go
@@ -7,7 +7,6 @@ import (
"net/http"
"strings"
"testing"
- "time"
"github.com/miekg/dns"
)
@@ -101,8 +100,6 @@ func TestReloadMetricsHealth(t *testing.T) {
}
defer c1.Stop()
- time.Sleep(100 * time.Millisecond)
-
// Health
resp, err := http.Get("http://localhost:53184/health")
if err != nil {