agent: resolve flaky test by checking cache hits increase, rather than

exact
This commit is contained in:
Mitchell Hashimoto 2018-04-22 14:09:06 -07:00
parent 73838c9afa
commit 5abd43a567
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 4 additions and 2 deletions

View File

@ -2194,8 +2194,10 @@ func TestAgentConnectCARoots_list(t *testing.T) {
// Should be a cache hit! The data should've updated in the cache
// in the background so this should've been fetched directly from
// the cache.
require.Equal(cacheHits+1, a.cache.Hits())
cacheHits++
if v := a.cache.Hits(); v < cacheHits+1 {
t.Fatalf("expected at least one more cache hit, still at %d", v)
}
cacheHits = a.cache.Hits()
}
}