From 9d4e937aef9f88fab197bda879b1fc6a4f17a3b7 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Sun, 5 Oct 2014 02:46:51 +0400 Subject: [PATCH] Make use of time.After convenience function --- buffer_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/buffer_test.go b/buffer_test.go index 70b158f..d6968e9 100644 --- a/buffer_test.go +++ b/buffer_test.go @@ -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") }