Flaky Test [Build&Test / filebeat-build / TestDefaultHarvesterGroup/assert_a_harvester_for_same_source_cannot_be_started – github.com/elastic/beats/v7/filebeat/input/filestream/internal/input-logfile]
- Dominant language
- Go
- Stars
- 12.7k
- Forks
- 5k
- Avg merge
- 2d 15m
- Merged PRs (30d)
- 385
Description
## Flaky Test
* **Test Name:** `Build&Test / filebeat-build / TestDefaultHarvesterGroup/assert_a_harvester_for_same_source_cannot_be_started – github.com/elastic/beats/v7/filebeat/input/filestream/internal/input-logfile`
* **Artifact Link:** https://beats-ci.elastic.co/blue/organizations/jenkins/Beats%2Fbeats%2FPR-26557/detail/PR-26557/1/
* **PR:** #26557
* **Commit:** 58c451770edff052b7034921ac66bcc608daa1f1
### Error details
```
Failed
```
### Stack Trace
```
=== RUN TestDefaultHarvesterGroup/assert_a_harvester_for_same_source_cannot_be_started
coverage: 40.0% of statements
panic: test timed out after 10m0s
goroutine 52 [running]:
testing.(*M).startAlarm.func1()
/usr/local/go/src/testing/testing.go:1700 +0xe5
created by time.goFunc
/usr/local/go/src/time/sleep.go:180 +0x45
goroutine 1 [chan receive, 9 minutes]:
testing.(*T).Run(0xc00066cc00, 0xcdcab1, 0x19, 0xcfdbb8, 0x493101)
/usr/local/go/src/testing/testing.go:1239 +0x2da
testing.runTests.func1(0xc000582300)
/usr/local/go/src/testing/testing.go:1511 +0x78
testing.tRunner(0xc000582300, 0xc00063fda8)
/usr/local/go/src/testing/testing.go:1193 +0xef
testing.runTests(0xc0005f8000, 0x1249b00, 0x11, 0x11, 0xc02ee0460fc5dd5b, 0x8bb59ca0c4, 0x1257c60, 0xcd48f4)
/usr/local/go/src/testing/testing.go:1509 +0x2fe
testing.(*M).Run(0xc0005f4000, 0x0)
/usr/local/go/src/testing/testing.go:1417 +0x1eb
main.main()
_testmain.go:141 +0x1c5
goroutine 45 [chan receive, 9 minutes]:
testing.(*T).Run(0xc00066d080, 0xcef68c, 0x34, 0xc0005af750, 0xd9d101)
/usr/local/go/src/testing/testing.go:1239 +0x2da
github.com/elastic/beats/v7/filebeat/input/filestream/internal/input-logfile.TestDefaultHarvesterGroup(0xc00066cc00)
/go/src/github.com/elastic/beats/filebeat/input/filestream/internal/input-logfile/harvester_test.go:155 +0x18a
testing.tRunner(0xc00066cc00, 0xcfdbb8)
/usr/local/go/src/testing/testing.go:1193 +0xef
created by testing.(*T).Run
/usr/local/go/src/testing/testing.go:1238 +0x2b3
goroutine 49 [sleep]:
time.Sleep(0x989680)
/usr/local/go/src/runtime/time.go:193 +0xd2
github.com/elastic/beats/v7/libbeat/tests/resources.(*GoroutinesChecker).WaitUntilIncreased(0xc00006fe28, 0x2)
/go/src/github.com/elastic/beats/libbeat/tests/resources/goroutines.go:95 +0x2c
github.com/elastic/beats/v7/filebeat/input/filestream/internal/input-logfile.TestDefaultHarvesterGroup.func5(0xc00066d080)
/go/src/github.com/elastic/beats/filebeat/input/filestream/internal/input-logfile/harvester_test.go:166 +0x251
testing.tRunner(0xc00066d080, 0xc0005af750)
/usr/local/go/src/testing/testing.go:1193 +0xef
created by testing.(*T).Run
/usr/local/go/src/testing/testing.go:1238 +0x2b3
goroutine 51 [chan receive, 9 minutes]:
github.com/elastic/beats/v7/filebeat/input/filestream/internal/input-logfile.blockUntilCancelOnRun(0xc0005af810, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/src/github.com/elastic/beats/filebeat/input/filestream/internal/input-logfile/harvester_test.go:354 +0x4e
github.com/elastic/beats/v7/filebeat/input/filestream/internal/input-logfile.(*mockHarvester).Run(0xc0005b07a0, 0xc0005af810, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/src/github.com/elastic/beats/filebeat/input/filestream/internal/input-logfile/harvester_test.go:333 +0x19b
github.com/elastic/beats/v7/filebeat/input/filestream/internal/input-logfile.startHarvester.func1(0x7fc2c5144f50, 0xc0005b3c00, 0x0, 0x0)
/go/src/github.com/elastic/beats/filebeat/input/filestream/internal/input-logfile/harvester.go:206 +0x9a8
github.com/elastic/go-concert/unison.(*TaskGroup).Go.func1(0xc000672ad0, 0xc0005b3c40)
/go/pkg/mod/github.com/elastic/go-concert@v0.1.0/unison/taskgroup.go:124 +0x99
created by github.com/elastic/go-concert/unison.(*TaskGroup).Go
/go/pkg/mod/github.com/elastic/go-concert@v0.1.0/unison/taskgroup.go:122 +0xda
```
Contributor guide
Research direction
Start with TestDefaultHarvesterGroup and the mock harvester in filebeat/input/filestream/internal/input-logfile/harvester_test.go, then inspect GoroutinesChecker.WaitUntilIncreased in libbeat/tests/resources/goroutines.go. Reproduce the test timeout and trace the blocked goroutine; done means the test completes reliably without the ten-minute timeout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100