From 4fa7e719f4252bd97d36b1a748e911cea83c93b1 Mon Sep 17 00:00:00 2001 From: Krasi Georgiev Date: Mon, 26 Feb 2018 12:03:50 +0200 Subject: [PATCH] race in Triton SD Test (#3885) --- discovery/triton/triton_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/discovery/triton/triton_test.go b/discovery/triton/triton_test.go index a108ed04b7..47f131b5a4 100644 --- a/discovery/triton/triton_test.go +++ b/discovery/triton/triton_test.go @@ -86,7 +86,11 @@ func TestTritonSDRun(t *testing.T) { assert.Nil(t, err) assert.NotNil(t, td) - go td.Run(ctx, ch) + wait := make(chan struct{}) + go func() { + td.Run(ctx, ch) + close(wait) + }() select { case <-time.After(60 * time.Millisecond): @@ -96,6 +100,7 @@ func TestTritonSDRun(t *testing.T) { } cancel() + <-wait } func TestTritonSDRefreshNoTargets(t *testing.T) {