[Flaky Test] x-pack/filebeat/input/cometd.TestInputStop_Wait
- Dominant language
- Go
- Stars
- 12.7k
- Forks
- 5k
- Avg merge
- 2d 15m
- Merged PRs (30d)
- 385
Description
## Flaky Test
* **Test Name:** x-pack/filebeat/input/cometd.TestInputStop_Wait
* **Link:** https://github.com/elastic/beats/blob/ff927c990c569f81698ab8a83180838bb95fa085/x-pack/filebeat/input/cometd/input_test.go#L119
* **Branch:** main
* **Artifact Link:** https://beats-ci.elastic.co/job/Beats/job/beats/job/PR-36915/33/testReport/junit/github/com_elastic_beats_v7_x-pack_filebeat_input_cometd/Build_Test___x_pack_filebeat_windows_2022_windows_2022___TestInputStop_Wait/
### Stack Trace
```
=== RUN TestInputStop_Wait
input_test.go:183:
Error Trace: C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/src/github.com/elastic/beats/x-pack/filebeat/input/cometd/input_test.go:183
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/runtime/asm_amd64.s:1650
Error: Not equal:
expected: 0
actual : 1
Test: TestInputStop_Wait
coverage: 70.9% of statements
panic: test timed out after 10m0s
running tests:
TestInputStop_Wait (10m0s)
goroutine 85 [running]:
testing.(*M).startAlarm.func1()
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/testing/testing.go:2259 +0x3b9
created by time.goFunc
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/time/sleep.go:176 +0x2d
goroutine 1 [chan receive]:
testing.(*T).Run(0xc00024b380, {0x116b59c?, 0x7d7a4d?}, 0x121a270)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/testing/testing.go:1649 +0x3c8
testing.runTests.func1(0x1aaa3e0?)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/testing/testing.go:2054 +0x3e
testing.tRunner(0xc00024b380, 0xc0003dfc38)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/testing/testing.go:1595 +0xff
testing.runTests(0xc000257cc0?, {0x1a99e80, 0xf, 0xf}, {0xc00024de70?, 0xc0003dfcf8?, 0x1aa9800?})
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/testing/testing.go:2052 +0x445
testing.(*M).Run(0xc000257cc0)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/testing/testing.go:1925 +0x636
main.main()
_testmain.go:109 +0x1bf
goroutine 19 [semacquire]:
sync.runtime_Semacquire(0xc0002f1e30?)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x12fb428?)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/sync/waitgroup.go:116 +0x48
github.com/elastic/beats/v7/x-pack/filebeat/input/cometd.TestInputStop_Wait(0xc0001044e0)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/src/github.com/elastic/beats/x-pack/filebeat/input/cometd/input_test.go:189 +0x777
testing.tRunner(0xc0001044e0, 0x121a270)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/testing/testing.go:1595 +0xff
created by testing.(*T).Run in goroutine 1
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/testing/testing.go:1648 +0x3ad
goroutine 20 [IO wait]:
internal/poll.runtime_pollWait(0x1d66df14e58, 0x72)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/runtime/netpoll.go:343 +0x85
internal/poll.(*pollDesc).wait(0x0?, 0x0?, 0x0)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/internal/poll/fd_poll_runtime.go:84 +0x27
internal/poll.execIO(0xc00012a018, 0xc000317c00)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/internal/poll/fd_windows.go:175 +0xe6
internal/poll.(*FD).acceptOne(0xc00012a000, 0x21c, {0xc0000422d0?, 0xc000100400?, 0x121a968?}, 0xc000317d10?)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/internal/poll/fd_windows.go:944 +0x67
internal/poll.(*FD).Accept(0xc00012a000, 0xc000317dd8)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/internal/poll/fd_windows.go:978 +0x1bc
net.(*netFD).accept(0xc00012a000)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/net/fd_windows.go:166 +0x54
net.(*TCPListener).accept(0xc000116080)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/net/tcpsock_posix.go:152 +0x1e
net.(*TCPListener).Accept(0xc000116080)
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/net/tcpsock.go:315 +0x30
net/http.(*Server).Serve(0xc000130000, {0x12fdab0, 0xc000116080})
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/net/http/server.go:3056 +0x364
net/http/httptest.(*Server).goServe.func1()
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/net/http/httptest/server.go:310 +0x5b
created by net/http/httptest.(*Server).goServe in goroutine 19
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/.gvm/versions/go1.21.7.windows.amd64/src/net/http/httptest/server.go:308 +0x65
goroutine 44 [chan receive (nil chan)]:
github.com/elastic/beats/v7/x-pack/filebeat/input/cometd.NewInput.func1()
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/src/github.com/elastic/beats/x-pack/filebeat/input/cometd/input.go:172 +0x32
created by github.com/elastic/beats/v7/x-pack/filebeat/input/cometd.NewInput in goroutine 36
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/src/github.com/elastic/beats/x-pack/filebeat/input/cometd/input.go:171 +0x397
goroutine 27 [chan receive (nil chan)]:
github.com/elastic/beats/v7/x-pack/filebeat/input/cometd.NewInput.func1()
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/src/github.com/elastic/beats/x-pack/filebeat/input/cometd/input.go:172 +0x32
created by github.com/elastic/beats/v7/x-pack/filebeat/input/cometd.NewInput in goroutine 19
C:/Users/jenkins/workspace/PR-36915-33-d94514b3-84d2-4c4d-9511-b0eb73e7e33a/src/github.com/elastic/beats/x-pack/filebeat/input/cometd/input.go:171 +0x397
```
Contributor guide
Research direction
Start with x-pack/filebeat/input/cometd/input_test.go at TestInputStop_Wait and compare its failure at lines 183-189 with the shutdown code in input.go around lines 171-172. Run the focused test on the Windows environment described by the artifact and inspect the timeout and goroutine dump. Done means the test reliably completes without the assertion failure or timeout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100