1
0
Fork 0

Make use of time.After convenience function

This commit is contained in:
Gregory Eremin 2014-10-05 02:46:51 +04:00
parent 3495977a8d
commit 9d4e937aef
1 changed files with 2 additions and 4 deletions

View File

@ -78,7 +78,7 @@ func TestLookup(t *testing.T) {
// Got to wait for aggragation coroutine to finish
// XXX: Sleep is no good for testing. Need to come up with a better solution
time.Sleep(10 * time.Millisecond)
time.Sleep(100 * time.Millisecond)
var (
res map[string]*influxdb.Series
@ -203,12 +203,10 @@ func TestAggregate(t *testing.T) {
},
)
timer := time.NewTimer(time.Second)
var series []*influxdb.Series
select {
case series = <-res:
case <-timer.C:
case <-time.After(100 * time.Millisecond):
t.Error("Flushing did not happen")
}