Skip to content

Commit

Permalink
race in Triton SD Test (prometheus#3885)
Browse files Browse the repository at this point in the history
  • Loading branch information
krasi-georgiev authored and brian-brazil committed Feb 26, 2018
1 parent 7af69ad commit 4fa7e71
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion discovery/triton/triton_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -96,6 +100,7 @@ func TestTritonSDRun(t *testing.T) {
}

cancel()
<-wait
}

func TestTritonSDRefreshNoTargets(t *testing.T) {
Expand Down

0 comments on commit 4fa7e71

Please sign in to comment.