From 763b64f3a8630b7ee60c818ce05648c14ba234d2 Mon Sep 17 00:00:00 2001 From: kruskall <99559985+kruskall@users.noreply.github.com> Date: Tue, 4 Jun 2024 10:50:34 +0200 Subject: [PATCH] test: set flush_interval to 1ms for es output config (#13275) 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 --- internal/beater/beatertest/output.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/beater/beatertest/output.go b/internal/beater/beatertest/output.go index 6a5f3df125e..6775a5cbc3a 100644 --- a/internal/beater/beatertest/output.go +++ b/internal/beater/beatertest/output.go @@ -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