From d8604783be0eff729b1b2513e90732941e4d8fba Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 23:45:27 +0000 Subject: [PATCH] test: sync access to countRun counter in TestRunnerFactory (#42097) (#42129) countRun is incremented and checked in different goroutines to avoid race conditions, only mark the workgroup as done after incrementing the counter (cherry picked from commit 7411cc4deb9e558232464ec0b4d4f8f9d46ccf26) Co-authored-by: kruskall <99559985+kruskall@users.noreply.github.com> --- filebeat/input/v2/compat/compat_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filebeat/input/v2/compat/compat_test.go b/filebeat/input/v2/compat/compat_test.go index 554701cdae8..2617fd26ebe 100644 --- a/filebeat/input/v2/compat/compat_test.go +++ b/filebeat/input/v2/compat/compat_test.go @@ -85,8 +85,8 @@ func TestRunnerFactory_CheckConfig(t *testing.T) { return &inputest.MockInput{ OnTest: func(_ v2.TestContext) error { countTest++; return nil }, OnRun: func(_ v2.Context, _ beat.PipelineConnector) error { - runWG.Done() countRun++ + runWG.Done() return nil }, }, nil