Skip to content

Commit

Permalink
Fix incorrect results in ping plugin (influxdata#6581)
Browse files Browse the repository at this point in the history
  • Loading branch information
glinton authored and danielnelson committed Nov 5, 2019
1 parent 9efc376 commit f0a5784
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/inputs/ping/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,12 @@ func (p *Ping) pingToURLNative(destination string, acc telegraf.Accumulator) {
if strings.Contains(err.Error(), "not permitted") {
sent.sent = false
}
sents <- sent
return
}

resps <- resp
sents <- sent
}(i + 1)
}
}
Expand Down
1 change: 1 addition & 0 deletions plugins/inputs/ping/ping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,5 @@ func TestPingGatherNative(t *testing.T) {

assert.NoError(t, acc.GatherError(p.Gather))
assert.True(t, acc.HasPoint("ping", map[string]string{"url": "localhost"}, "packets_transmitted", 5))
assert.True(t, acc.HasPoint("ping", map[string]string{"url": "localhost"}, "packets_received", 5))
}

0 comments on commit f0a5784

Please sign in to comment.