Fix output panic for -test flag

This commit is contained in:
Cameron Sparr 2015-10-21 18:32:43 -06:00
parent 891f3af504
commit 2f08577967
1 changed files with 11 additions and 1 deletions

View File

@ -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)