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:
Miek Gieben
2019-08-01 12:51:37 +00:00
committed by Yong Tang
parent 3219a2b93a
commit a01b202b6a
6 changed files with 11 additions and 16 deletions

View File

@@ -54,7 +54,7 @@ Transfer:
z.Lock()
z.Tree = z1.Tree
z.Apex = z1.Apex
*z.Expired = false
z.Expired = false
z.Unlock()
log.Infof("Transferred: %s from %s", z.origin, tr)
return nil
@@ -129,7 +129,7 @@ Restart:
if !retryActive {
break
}
*z.Expired = true
z.Expired = true
case <-retryTicker.C:
if !retryActive {