Skip to content

Commit

Permalink
Fix output panic for -test flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrc committed Oct 22, 2015
1 parent 891f3af commit 2f08577
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,17 @@ func (a *Agent) Test() error {
defer close(shutdown)
pointChan := make(chan *client.Point)

go a.flusher(shutdown, pointChan)
// dummy receiver for the point channel
go func() {
for {
select {
case <-pointChan:
// do nothing
case <-shutdown:
return
}
}
}()

for _, plugin := range a.plugins {
acc := NewAccumulator(plugin.config, pointChan)
Expand Down

0 comments on commit 2f08577

Please sign in to comment.