Remove sleep from riemann test

This commit is contained in:
Cameron Sparr 2017-02-28 12:46:27 +00:00
parent 42a41d33cc
commit 6f2eeae498
No known key found for this signature in database
GPG Key ID: 19E67263DCB25D0F
1 changed files with 10 additions and 1 deletions

View File

@ -193,7 +193,16 @@ func TestConnectAndWrite(t *testing.T) {
err = r.Write(metrics)
require.NoError(t, err)
time.Sleep(200 * time.Millisecond)
start := time.Now()
for true {
events, _ := r.client.Query(`tagged "docker"`)
if len(events) > 0 {
break
}
if time.Since(start) > time.Second {
break
}
}
// are there any "docker" tagged events in Riemann?
events, err := r.client.Query(`tagged "docker"`)