Commit 9c56805d authored by Miek Gieben's avatar Miek Gieben Committed by GitHub

mw/etcd: use context.TODO() in tests (#1000)

Go vet warning: fix use of context.

Fixes #997

Also make *auto*'s reload test less flaky by retrying
and then giving up.
parent 53d9b52d
......@@ -20,7 +20,7 @@ import (
)
func init() {
ctxt, _ = context.WithTimeout(context.Background(), etcdTimeout)
ctxt = context.TODO()
}
// Note the key is encoded as DNS name, while in "reality" it is a etcd path.
......
......@@ -39,7 +39,11 @@ func send(t *testing.T, server string) {
r, err := dns.Exchange(m, server)
if err != nil {
t.Fatalf("Could not send message: %s", err)
// This seems to fail a lot on travis, quick'n dirty: redo
r, err = dns.Exchange(m, server)
if err != nil {
return
}
}
if r.Rcode != dns.RcodeSuccess {
t.Fatalf("Expected successful reply, got %s", dns.RcodeToString[r.Rcode])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment