Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestDefaultMonitoringMapForRegistry is flaky on rerun #11171

Closed
kruskall opened this issue Jul 10, 2023 · 0 comments · Fixed by #11511
Closed

TestDefaultMonitoringMapForRegistry is flaky on rerun #11171

kruskall opened this issue Jul 10, 2023 · 0 comments · Fixed by #11511
Labels
bug flaky test Unstable or unreliable test cases.

Comments

@kruskall
Copy link
Member

APM Server version (apm-server version): 8.10

Description of the problem including expected versus actual behavior:

TestDefaultMonitoringMapForRegistry fails when running tests multiple times

Steps to reproduce:

Please include a minimal but complete recreation of the problem,
including server configuration, agent(s) used, etc. The easier you make it
for us to reproduce it, the more likely that somebody will take the time to
look at it.

  1. go test -run=TestDefaultMonitoringMapForRegistry -race -count=100 -failfast ./...

Provide logs (if relevant):

--- FAIL: TestDefaultMonitoringMapForRegistry (0.00s)
panic: name mock-default already used [recovered]
        panic: name mock-default already used

goroutine 20 [running]:
testing.tRunner.func1.2({0x8cb840, 0xc0002bd260})
        /usr/lib/go/src/testing/testing.go:1526 +0x372
testing.tRunner.func1()
        /usr/lib/go/src/testing/testing.go:1529 +0x650
panic({0x8cb840, 0xc0002bd260})
        /usr/lib/go/src/runtime/panic.go:890 +0x263
github.com/elastic/elastic-agent-libs/monitoring.panicErr(...)
        /go/pkg/mod/github.com/elastic/elastic-agent-libs@v0.3.9/monitoring/registry.go:257
github.com/elastic/elastic-agent-libs/monitoring.(*Registry).Add(0xc00023c780, {0x93b176, 0xc}, {0x9dcc00, 0xc00023d2c0}, 0x1)
        /go/pkg/mod/github.com/elastic/elastic-agent-libs@v0.3.9/monitoring/registry.go:155 +0x19b
github.com/elastic/elastic-agent-libs/monitoring.(*Registry).NewRegistry(0xc00023c780, {0x93b176, 0xc}, {0x0, 0x0, 0x0})
        /go/pkg/mod/github.com/elastic/elastic-agent-libs@v0.3.9/monitoring/registry.go:94 +0x298
github.com/elastic/apm-server/internal/beater/request.TestDefaultMonitoringMapForRegistry(0x0?)
        /apm-server/internal/beater/request/result_test.go:193 +0x69
testing.tRunner(0xc0002ded00, 0x96c858)
        /usr/lib/go/src/testing/testing.go:1576 +0x217
created by testing.(*T).Run
        /usr/lib/go/src/testing/testing.go:1629 +0x806
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug flaky test Unstable or unreliable test cases.
Projects
None yet
2 participants