author | Alberto Bertogli
<albertito@blitiri.com.ar> 2016-05-30 10:35:15 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2016-05-30 10:35:15 UTC |
parent | d19c4a365efa496978b7fc518a77e9fda8748f79 |
internal/dnstox/caching_test.go | +8 | -9 |
diff --git a/internal/dnstox/caching_test.go b/internal/dnstox/caching_test.go index 15200f7..778972d 100644 --- a/internal/dnstox/caching_test.go +++ b/internal/dnstox/caching_test.go @@ -71,15 +71,6 @@ func TestBasic(t *testing.T) { if !r.init { t.Errorf("caching resolver did not initialize backing") } - go c.Maintain() - - // Check that the back resolver's Maintain() is called. - select { - case <-r.maintain: - t.Log("Maintain() called") - case <-time.After(1 * time.Second): - t.Errorf("back resolver Maintain() was not called") - } resetStats() @@ -140,6 +131,14 @@ func TestTTL(t *testing.T) { go c.Maintain() resetStats() + // Check that the back resolver's Maintain() is called. + select { + case <-r.maintain: + t.Log("Maintain() called") + case <-time.After(1 * time.Second): + t.Errorf("back resolver Maintain() was not called") + } + start := time.Now() for time.Since(start) < 1*time.Second { resp = queryA(t, c, "", "test.", "1.2.3.4")