From 9fb026c2df80aede7bf3892e6b178d17d12858f9 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Fri, 10 Jul 2020 13:58:38 -0700 Subject: [PATCH] Set log output before starting plugin (#7820) (cherry picked from commit cd97534315b8ea922c515439acf15a7b8dd2d4e2) --- plugins/inputs/tail/tail_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/inputs/tail/tail_test.go b/plugins/inputs/tail/tail_test.go index 874587f8ee78c..a8eae196ce588 100644 --- a/plugins/inputs/tail/tail_test.go +++ b/plugins/inputs/tail/tail_test.go @@ -32,6 +32,9 @@ func TestTailBadLine(t *testing.T) { tmpfile.Close() + buf := &bytes.Buffer{} + log.SetOutput(buf) + tt := NewTail() tt.Log = testutil.Logger{} tt.FromBeginning = true @@ -44,9 +47,6 @@ func TestTailBadLine(t *testing.T) { acc := testutil.Accumulator{} require.NoError(t, tt.Start(&acc)) - buf := &bytes.Buffer{} - log.SetOutput(buf) - require.NoError(t, acc.GatherError(tt.Gather)) acc.Wait(1)