mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
Fixes races in test and klog (#3079)
Various fixes to make things less flaky: * kubernetes: put klog.SetOutput in the setup function, not in the init function to see if that helps * file: make z.Expired a boolean instead of a pointer to a boolean * test: fix TestSecondaryZoneTransfer test, which wasn't actually testing in the right way. It's more right now, but may still be racy (race introduced because a file's lazy loading of zones) Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -73,13 +73,13 @@ func TestSecondaryZoneTransfer(t *testing.T) {
|
||||
var r *dns.Msg
|
||||
// This is now async; we we need to wait for it to be transferred.
|
||||
for i := 0; i < 10; i++ {
|
||||
r, _ = dns.Exchange(m, udp)
|
||||
if len(r.Answer) == 0 {
|
||||
r, err = dns.Exchange(m, udp)
|
||||
if len(r.Answer) != 0 {
|
||||
break
|
||||
}
|
||||
time.Sleep(100 * time.Microsecond)
|
||||
}
|
||||
if len(r.Answer) != 0 {
|
||||
if len(r.Answer) == 0 {
|
||||
t.Fatalf("Expected answer section")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user