aboutsummaryrefslogtreecommitdiff
path: root/test/metrics_test.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2020-10-15 13:19:39 +0200
committerGravatar GitHub <noreply@github.com> 2020-10-15 04:19:39 -0700
commit6938dac21d9a79bc34f4347a52fda4d1bf24b259 (patch)
tree14ff42768b6461be9347d396cdd0c3dac768be44 /test/metrics_test.go
parent269c0c5dabe2839c29e42b30faa7142ca3e0296e (diff)
downloadcoredns-6938dac21d9a79bc34f4347a52fda4d1bf24b259.tar.gz
coredns-6938dac21d9a79bc34f4347a52fda4d1bf24b259.tar.zst
coredns-6938dac21d9a79bc34f4347a52fda4d1bf24b259.zip
reduce sleeps (#4205)
This reduces the amount of sleep time to speed up testing. master: PASS ok github.com/coredns/coredns/test 42.088s 12,33s user 1,30s system 44,29s elapsed 30%CPU () this branch: PASS ok github.com/coredns/coredns/test 33.527s Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'test/metrics_test.go')
-rw-r--r--test/metrics_test.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/metrics_test.go b/test/metrics_test.go
index 6641d615c..38092f009 100644
--- a/test/metrics_test.go
+++ b/test/metrics_test.go
@@ -78,7 +78,7 @@ func TestMetricsAuto(t *testing.T) {
corefile := `org:0 {
auto {
directory ` + tmpdir + ` db\.(.*) {1}
- reload 1s
+ reload 0.1s
}
prometheus localhost:0
}`
@@ -98,8 +98,7 @@ func TestMetricsAuto(t *testing.T) {
if err = ioutil.WriteFile(filepath.Join(tmpdir, "db.example.org"), []byte(zoneContent), 0644); err != nil {
t.Fatal(err)
}
- // TODO(miek): make the auto sleep even less.
- time.Sleep(1100 * time.Millisecond) // wait for it to be picked up
+ time.Sleep(110 * time.Millisecond) // wait for it to be picked up
m := new(dns.Msg)
m.SetQuestion("www.example.org.", dns.TypeA)
@@ -120,7 +119,7 @@ func TestMetricsAuto(t *testing.T) {
// Remove db.example.org again. And see if the metric stops increasing.
os.Remove(filepath.Join(tmpdir, "db.example.org"))
- time.Sleep(1100 * time.Millisecond) // wait for it to be picked up
+ time.Sleep(110 * time.Millisecond) // wait for it to be picked up
if _, err := dns.Exchange(m, udp); err != nil {
t.Fatalf("Could not send message: %s", err)
}