remove sleep from tests (#2555)

This commit is contained in:
Patrick Hemmer
2017-03-24 15:03:36 -04:00
committed by Daniel Nelson
parent 6588c4a1a7
commit c65cfb6a6e
21 changed files with 252 additions and 270 deletions

View File

@@ -207,14 +207,13 @@ func TestGenerateStatisticsInputParams(t *testing.T) {
}
func TestMetricsCacheTimeout(t *testing.T) {
ttl, _ := time.ParseDuration("5ms")
cache := &MetricCache{
Metrics: []*cloudwatch.Metric{},
Fetched: time.Now(),
TTL: ttl,
TTL: time.Minute,
}
assert.True(t, cache.IsValid())
time.Sleep(ttl)
cache.Fetched = time.Now().Add(-time.Minute)
assert.False(t, cache.IsValid())
}