Skip to content

Commit

Permalink
test: set flush_interval to 1ms for es output config
Browse files Browse the repository at this point in the history
beatertest is using a flush_bytes setting of 1 to avoid delay when flushing data but the
setting has no effect because it's too small.
As a result TestServerTracingEnabled and TestWrapServer are waiting for the flush interval
to kick in which defaults to 1s.
To fix the issue, set the flush_interval to 1ms to flush immediately and avoid delay.
TestWrapServer test time went from 1.2s to 0.01
TestServerTracingEnabled test time went from 1.2s to 0.01
  • Loading branch information
kruskall committed May 30, 2024
1 parent 0db2fdd commit 7d98272
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/beater/beatertest/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ func ElasticsearchOutputConfig(t testing.TB) (*agentconfig.C, <-chan []byte) {

cfg := agentconfig.MustNewConfigFrom(map[string]interface{}{
"output.elasticsearch": map[string]interface{}{
"enabled": true,
"hosts": []string{srv.URL},
"flush_bytes": "1", // no delay
"max_requests": "1", // only 1 concurrent request, for event ordering
"enabled": true,
"hosts": []string{srv.URL},
"flush_interval": "1ms", // no delay
"max_requests": "1", // only 1 concurrent request, for event ordering
},
})
return cfg, out
Expand Down

0 comments on commit 7d98272

Please sign in to comment.