From 6f2eeae49822782b85caf7639067685b812bc325 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Tue, 28 Feb 2017 12:46:27 +0000 Subject: [PATCH] Remove sleep from riemann test --- plugins/outputs/riemann/riemann_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/outputs/riemann/riemann_test.go b/plugins/outputs/riemann/riemann_test.go index e03d720ce..67a161be5 100644 --- a/plugins/outputs/riemann/riemann_test.go +++ b/plugins/outputs/riemann/riemann_test.go @@ -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"`)