Skip to content

Commit

Permalink
Call Init before Start in test mode (influxdata#6171)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson authored and Mathieu Lecarme committed Apr 17, 2020
1 parent 6cd7bbd commit 0897b4f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ func (a *Agent) Test(ctx context.Context, waitDuration time.Duration) error {
}
}

log.Printf("D! [agent] Initializing plugins")
err := a.initPlugins()
if err != nil {
return err
}

if hasServiceInputs {
log.Printf("D! [agent] Starting service inputs")
err := a.startServiceInputs(ctx, metricC)
Expand All @@ -191,11 +197,6 @@ func (a *Agent) Test(ctx context.Context, waitDuration time.Duration) error {
}

for _, input := range a.Config.Inputs {
err := input.Init()
if err != nil {
return err
}

select {
case <-ctx.Done():
return nil
Expand Down

0 comments on commit 0897b4f

Please sign in to comment.