From 2f08577967a937d5e93ca7cb975988fcef35f8e1 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Wed, 21 Oct 2015 18:32:43 -0600 Subject: [PATCH] Fix output panic for -test flag --- agent.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/agent.go b/agent.go index 00e42d8cd..8a5c47391 100644 --- a/agent.go +++ b/agent.go @@ -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)