elastic / elastic-agent

Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host.
Other
112 stars 126 forks source link

[Flaky Test]: TestFakeInputSuite/TestManager_Shipper – race detected during execution of test #4547

Open rdner opened 2 months ago

rdner commented 2 months ago

Failing test case

TestFakeInputSuite/TestManager_Shipper

Error message

race detected during execution of test

Build

https://buildkite.com/elastic/elastic-agent/builds/8204#018ebe96-b493-4fee-93e8-406705f3173b

OS

Windows

Stacktrace and notes

==================
WARNING: DATA RACE
Read at 0x00c004558043 by goroutine 877380:
  testing.(*common).logDepth()
      C:/Users/buildkite/.gvm/versions/go1.21.9.windows.amd64/src/testing/testing.go:1011 +0xcd
  testing.(*common).log()
      C:/Users/buildkite/.gvm/versions/go1.21.9.windows.amd64/src/testing/testing.go:1004 +0xa4
  testing.(*common).Logf()
      C:/Users/buildkite/.gvm/versions/go1.21.9.windows.amd64/src/testing/testing.go:1055 +0x6a
  github.com/elastic/elastic-agent/pkg/component/runtime.(*FakeInputSuite).TestManager_Shipper.func2()
      C:/buildkite-agent/builds/bk-agent-prod-gcp-1712594537523374013/elastic/elastic-agent/pkg/component/runtime/manager_fake_input_test.go:2882 +0x4ce
Previous write at 0x00c004558043 by goroutine 877354:
  testing.tRunner.func1()
      C:/Users/buildkite/.gvm/versions/go1.21.9.windows.amd64/src/testing/testing.go:1582 +0x8fa
  runtime.deferreturn()
      C:/Users/buildkite/.gvm/versions/go1.21.9.windows.amd64/src/runtime/panic.go:477 +0x30
  testing.(*T).Run.func1()
      C:/Users/buildkite/.gvm/versions/go1.21.9.windows.amd64/src/testing/testing.go:1648 +0x44
Goroutine 877380 (running) created at:
  github.com/elastic/elastic-agent/pkg/component/runtime.(*FakeInputSuite).TestManager_Shipper()
      C:/buildkite-agent/builds/bk-agent-prod-gcp-1712594537523374013/elastic/elastic-agent/pkg/component/runtime/manager_fake_input_test.go:2824 +0x160a
  runtime.call16()
      C:/Users/buildkite/.gvm/versions/go1.21.9.windows.amd64/src/runtime/asm_amd64.s:747 +0x47
  reflect.Value.Call()
      C:/Users/buildkite/.gvm/versions/go1.21.9.windows.amd64/src/reflect/value.go:380 +0xb5
  github.com/stretchr/testify/suite.Run.func1()
      C:/Users/buildkite/go/pkg/mod/github.com/stretchr/testify@v1.8.4/suite/suite.go:197 +0x766
  testing.tRunner()
      C:/Users/buildkite/.gvm/versions/go1.21.9.windows.amd64/src/testing/testing.go:1595 +0x261
  testing.(*T).Run.func1()
      C:/Users/buildkite/.gvm/versions/go1.21.9.windows.amd64/src/testing/testing.go:1648 +0x44
Goroutine 877354 (running) created at:
  testing.(*T).Run()
      C:/Users/buildkite/.gvm/versions/go1.21.9.windows.amd64/src/testing/testing.go:1648 +0x845
  github.com/stretchr/testify/suite.runTests()
      C:/Users/buildkite/go/pkg/mod/github.com/stretchr/testify@v1.8.4/suite/suite.go:242 +0x186
  github.com/stretchr/testify/suite.Run()
      C:/Users/buildkite/go/pkg/mod/github.com/stretchr/testify@v1.8.4/suite/suite.go:215 +0xa4e
  github.com/elastic/elastic-agent/pkg/component/runtime.TestFakeInputSuite()
      C:/buildkite-agent/builds/bk-agent-prod-gcp-1712594537523374013/elastic/elastic-agent/pkg/component/runtime/manager_fake_input_test.go:90 +0x3c
  testing.tRunner()
      C:/Users/buildkite/.gvm/versions/go1.21.9.windows.amd64/src/testing/testing.go:1595 +0x261
  testing.(*T).Run.func1()
      C:/Users/buildkite/.gvm/versions/go1.21.9.windows.amd64/src/testing/testing.go:1648 +0x44
==================
elasticmachine commented 2 months ago

Pinging @elastic/elastic-agent (Team:Elastic-Agent)