Export metrics in setup; so it also works after reload (#1715)

* brr; a sleep

* Shouldnt need a query
This commit is contained in:
Miek Gieben 2018-04-21 18:59:35 +01:00 committed by GitHub
parent acbcad7b4e
commit a466bb6fc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 12 deletions

View file

@ -5,6 +5,7 @@ import (
"io/ioutil"
"net/http"
"testing"
"time"
"github.com/miekg/dns"
)
@ -93,13 +94,7 @@ func TestReloadMetricsHealth(t *testing.T) {
}
defer c1.Stop()
// Send query to trigger monitoring to export on the new process
udp, _ := CoreDNSServerPorts(c1, 0)
m := new(dns.Msg)
m.SetQuestion("example.org.", dns.TypeA)
if _, err := dns.Exchange(m, udp); err != nil {
t.Fatal(err)
}
time.Sleep(1 * time.Second)
// Health
resp, err := http.Get("http://localhost:53184/health")