open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.1k stars 2.38k forks source link

Flaky test: sumologicextension/extension.go:810 #32785

Closed atoulme closed 2 months ago

atoulme commented 6 months ago

Describe the issue you're reporting

See https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/8899962769/job/24440490835?pr=32784

ERROR rerun aborted because previous run had a suspected panic and some test may not have run
=== Failed
=== FAIL: .  (0.00s)
panic: test timed out after 10m0s
running tests:
    TestRegisterEmptyCollectorNameForceRegistration (10m0s)

goroutine 643 [running]:
testing.(*M).startAlarm.func1()
    /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:2259 +0x259
created by time.goFunc
    /opt/hostedtoolcache/go/1.21.9/x64/src/time/sleep.go:176 +0x45

goroutine 1 [chan receive, 9 minutes]:
testing.tRunner.func1()
    /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:1561 +0x9ac
testing.tRunner(0xc0000f5380, 0xc00031fa20)
    /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:1601 +0x295
testing.runTests(0xc0001ed180?, {0x18dcfa0, 0x16, 0x16}, {0x492173?, 0x4?, 0x18e95c0?})
    /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:2052 +0x8ae
testing.(*M).Run(0xc0001ed180)
    /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:1925 +0xcd8
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.setupTestMain(0xc0001ed180?)
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension_test.go:39 +0x55
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.TestMain(0x11aa623?)
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/generated_package_test.go:12 +0x27
main.main()
    _testmain.go:125 +0x328

goroutine 36 [IO wait, 9 minutes]:
internal/poll.runtime_pollWait(0x7f2b953c4c90, 0x72)
    /opt/hostedtoolcache/go/1.21.9/x64/src/runtime/netpoll.go:343 +0x85
internal/poll.(*pollDesc).wait(0xc000158720, 0x4afb01?, 0x0)
    /opt/hostedtoolcache/go/1.21.9/x64/src/internal/poll/fd_poll_runtime.go:84 +0xb1
internal/poll.(*pollDesc).waitRead(...)
    /opt/hostedtoolcache/go/1.21.9/x64/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0xc000158700)
    /opt/hostedtoolcache/go/1.21.9/x64/src/internal/poll/fd_unix.go:611 +0x425
net.(*netFD).accept(0xc000158700)
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/fd_unix.go:172 +0x3e
net.(*TCPListener).accept(0xc000124620)
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/tcpsock_posix.go:152 +0x3e
net.(*TCPListener).Accept(0xc000124620)
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/tcpsock.go:315 +0x65
net/http.(*Server).Serve(0xc000388000, {0x131ef50, 0xc000124620})
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/server.go:3056 +0x5e8
net/http/httptest.(*Server).goServe.func1()
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/httptest/server.go:310 +0xd0
created by net/http/httptest.(*Server).goServe in goroutine 13
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/httptest/server.go:308 +0xa6

goroutine 430 [select]:
net/http.(*persistConn).writeLoop(0xc0002aa5a0)
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/transport.go:2421 +0x1bc
created by net/http.(*Transport).dialConn in goroutine 427
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/transport.go:1777 +0x266b

goroutine 139 [IO wait, 9 minutes]:
internal/poll.runtime_pollWait(0x7f2b953c4aa0, 0x72)
    /opt/hostedtoolcache/go/1.21.9/x64/src/runtime/netpoll.go:343 +0x85
internal/poll.(*pollDesc).wait(0xc0002a9420, 0xc00021fa01?, 0x0)
    /opt/hostedtoolcache/go/1.21.9/x64/src/internal/poll/fd_poll_runtime.go:84 +0xb1
internal/poll.(*pollDesc).waitRead(...)
    /opt/hostedtoolcache/go/1.21.9/x64/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0xc0002a9400)
    /opt/hostedtoolcache/go/1.21.9/x64/src/internal/poll/fd_unix.go:611 +0x425
net.(*netFD).accept(0xc0002a9400)
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/fd_unix.go:172 +0x3e
net.(*TCPListener).accept(0xc00004c8c0)
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/tcpsock_posix.go:152 +0x3e
net.(*TCPListener).Accept(0xc00004c8c0)
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/tcpsock.go:315 +0x65
net/http.(*Server).Serve(0xc00022e2d0, {0x131ef50, 0xc00004c8c0})
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/server.go:3056 +0x5e8
net/http/httptest.(*Server).goServe.func1()
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/httptest/server.go:310 +0xd0
created by net/http/httptest.(*Server).goServe in goroutine 28
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/httptest/server.go:308 +0xa6

goroutine 13 [select]:
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).registerCollectorWithBackoff(0xc00035e160, {0x1322008, 0x1919b80}, {0xc0003f4094, 0xc})
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:551 +0x565
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).getCredentialsByRegistering(0xc00035e160, {0x1322008, 0x1919b80})
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:373 +0x10b
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).getCredentials(0xc00035e160, {0x1322008, 0x1919b80})
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:362 +0x8b0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).Start(0xc00035e160, {0x1322008, 0x1919b80}, {0x131c6d0?, 0x1919b80})
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:185 +0x1d8
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.TestRegisterEmptyCollectorNameForceRegistration(0xc00029c820)
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension_test.go:656 +0x10a8
testing.tRunner(0xc00029c820, 0x1201c70)
    /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:1595 +0x262
created by testing.(*T).Run in goroutine 1
    /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:1648 +0x846

goroutine 148 [chan receive, 9 minutes]:
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).heartbeatLoop.func1()
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:569 +0x65
created by github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).heartbeatLoop in goroutine 147
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:567 +0x245

goroutine 153 [select]:
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).heartbeatLoop(0xc000240dc0)
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:614 +0xda5
created by github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).Start in goroutine 12
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:207 +0x5cb

goroutine 147 [select]:
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).heartbeatLoop(0xc000240000)
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:614 +0xda5
created by github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).Start in goroutine 19
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:207 +0x5cb

goroutine 154 [chan receive, 9 minutes]:
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).heartbeatLoop.func1()
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:569 +0x65
created by github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).heartbeatLoop in goroutine 153
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:567 +0x245

goroutine 429 [IO wait]:
internal/poll.runtime_pollWait(0x7f2b953c43d8, 0x72)
    /opt/hostedtoolcache/go/1.21.9/x64/src/runtime/netpoll.go:343 +0x85
internal/poll.(*pollDesc).wait(0xc00018d0a0, 0xc0002e5000?, 0x0)
    /opt/hostedtoolcache/go/1.21.9/x64/src/internal/poll/fd_poll_runtime.go:84 +0xb1
internal/poll.(*pollDesc).waitRead(...)
    /opt/hostedtoolcache/go/1.21.9/x64/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc00018d080, {0xc0002e5000, 0x1000, 0x1000})
    /opt/hostedtoolcache/go/1.21.9/x64/src/internal/poll/fd_unix.go:164 +0x405
net.(*netFD).Read(0xc00018d080, {0xc0002e5000, 0x1000, 0x1000})
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/fd_posix.go:55 +0x4b
net.(*conn).Read(0xc0001c2598, {0xc0002e5000, 0x1000, 0x1000})
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/net.go:179 +0xad
net/http.(*persistConn).Read(0xc0002aa5a0, {0xc0002e5000, 0x1000, 0x1000})
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/transport.go:1954 +0x105
bufio.(*Reader).fill(0xc0003ef200)
    /opt/hostedtoolcache/go/1.21.9/x64/src/bufio/bufio.go:113 +0x29a
bufio.(*Reader).Peek(0xc0003ef200, 0x1)
    /opt/hostedtoolcache/go/1.21.9/x64/src/bufio/bufio.go:151 +0xc7
net/http.(*persistConn).readLoop(0xc0002aa5a0)
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/transport.go:2118 +0x354
created by net/http.(*Transport).dialConn in goroutine 427
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/transport.go:1776 +0x25da

goroutine 440 [IO wait]:
internal/poll.runtime_pollWait(0x7f2b953c41e8, 0x72)
    /opt/hostedtoolcache/go/1.21.9/x64/src/runtime/netpoll.go:343 +0x85
internal/poll.(*pollDesc).wait(0xc0002161a0, 0xc0004fb000?, 0x0)
    /opt/hostedtoolcache/go/1.21.9/x64/src/internal/poll/fd_poll_runtime.go:84 +0xb1
internal/poll.(*pollDesc).waitRead(...)
    /opt/hostedtoolcache/go/1.21.9/x64/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc000216180, {0xc0004fb000, 0x1000, 0x1000})
    /opt/hostedtoolcache/go/1.21.9/x64/src/internal/poll/fd_unix.go:164 +0x405
net.(*netFD).Read(0xc000216180, {0xc0004fb000, 0x1000, 0x1000})
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/fd_posix.go:55 +0x4b
net.(*conn).Read(0xc000202010, {0xc0004fb000, 0x1000, 0x1000})
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/net.go:179 +0xad
net/http.(*connReader).Read(0xc00011c270, {0xc0004fb000, 0x1000, 0x1000})
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/server.go:791 +0x2b2
bufio.(*Reader).fill(0xc0004fc120)
    /opt/hostedtoolcache/go/1.21.9/x64/src/bufio/bufio.go:113 +0x29a
bufio.(*Reader).Peek(0xc0004fc120, 0x4)
    /opt/hostedtoolcache/go/1.21.9/x64/src/bufio/bufio.go:151 +0xc7
net/http.(*conn).serve(0xc0004821b0, {0x13220b0, 0xc0001ff200})
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/server.go:2044 +0xe7c
created by net/http.(*Server).Serve in goroutine 36
    /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/server.go:3086 +0x86d
FAIL    github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension  600.026s

make[2]: *** [../../Makefile.Common:131: test-with-cover] Error 3
make[1]: *** [Makefile:169: extension/sumologicextension] Error 2
make: *** [Makefile:121: gotest-with-cover] Error 2
=== FAIL: . TestRegisterEmptyCollectorNameForceRegistration (unknown)
2024-04-30T18:45:22.961Z    INFO    credentials/credentialsstore_localfs.go:179 Collector registration credentials stored locally   {"path": "/tmp/otelcol-sumo-store-credentials-test-1610467527/5ad462cbef0fa4bf7724c9c159d3cf23f3b7168efdb8f22b35128a1e6b314a3c"}
2024-04-30T18:45:22.961Z    INFO    credentials/credentialsstore_localfs.go:128 Collector registration credentials retrieved from local fs  {"path": "/tmp/otelcol-sumo-store-credentials-test-1610467527/5ad462cbef0fa4bf7724c9c159d3cf23f3b7168efdb8f22b35128a1e6b314a3c"}
2024-04-30T18:45:22.961Z    INFO    sumologicextension/extension.go:227 Validating collector credentials... {"collector_credential_id": "collectorId", "collector_id": "id"}
2024-04-30T18:45:22.963Z    INFO    sumologicextension/extension.go:331 Found stored credentials, skipping registration {"collector_name": ""}
2024-04-30T18:45:22.973Z    INFO    sumologicextension/extension.go:810 Updating collector metadata {"collector_name": "", "collector_id": "id", "URL": "http://127.0.0.1:41453/api/v1/otCollectors/metadata", "body": "{\"hostDetails\":{\"name\":\"fv-az711-219\",\"osName\":\"linux\",\"osVersion\":\"22.04\",\"environment\":\"\"},\"collectorDetails\":{\"runningVersion\":\"1.0.0\"},\"networkDetails\":{\"hostIpAddress\":\"10.1.0.58\"},\"tagDetails\":{\"sumo.disco.enabled\":\"true\"}}\n"}
    extension_test.go:603: 
            Error Trace:    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension_test.go:603
                                        /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/server.go:2136
                                        /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/server.go:2938
                                        /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/server.go:2009
                                        /opt/hostedtoolcache/go/1.21.9/x64/src/runtime/asm_amd64.s:1650
            Error:          Not equal: 
                            expected: "/api/v1/collector/register"
                            actual  : "/api/v1/collector/heartbeat"

                            Diff:
                            --- Expected
                            +++ Actual
                            @@ -1 +1 @@
                            -/api/v1/collector/register
                            +/api/v1/collector/heartbeat
            Test:           TestRegisterEmptyCollectorNameForceRegistration
    extension_test.go:621: 
            Error Trace:    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension_test.go:621
                                        /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/server.go:2136
                                        /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/server.go:2938
                                        /opt/hostedtoolcache/go/1.21.9/x64/src/net/http/server.go:2009
                                        /opt/hostedtoolcache/go/1.21.9/x64/src/runtime/asm_amd64.s:1650
            Error:          Not equal: 
                            expected: "/api/v1/otCollectors/metadata"
                            actual  : "/api/v1/collector/register"

                            Diff:
                            --- Expected
                            +++ Actual
                            @@ -1 +1 @@
                            -/api/v1/otCollectors/metadata
                            +/api/v1/collector/register
            Test:           TestRegisterEmptyCollectorNameForceRegistration
2024-04-30T18:45:22.978Z    WARN    sumologicextension/extension.go:478 Collector name already in use, registered modified name {"#": 1, "registered_name": ""}
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).registerCollector
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:478
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).registerCollectorWithBackoff
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:530
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).getCredentialsByRegistering
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:373
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).getCredentials
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:362
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.(*SumologicExtension).Start
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension.go:185
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sumologicextension.TestLocalFSCredentialsStore_WorkCorrectlyForMultipleExtensions
    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/extension/sumologicextension/extension_test.go:478
testing.tRunner
    /opt/hostedtoolcache/go/1.21.9/x64/src/testing/testing.go:1595
2024-04-30T18:45:22.979Z    INFO    sumologicextension/extension.go:536 Collector registration finished successfully    {"#": 1, "collector_name": "", "collector_id": "id"}
2024-04-30T18:45:22.979Z    INFO    credentials/credentialsstore_localfs.go:179 Collector registration credentials stored locally   {"#": 1, "path": "/tmp/otelcol-sumo-store-credentials-multiple-extensions-test-3830748126/f23852e21ba9ebd2dc714b7d0777db64399acc8a98f05[378](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/8899962769/job/24440490835?pr=32784#step:10:379)2f08ac654bfe1d5d"}
github-actions[bot] commented 6 months ago

Pinging code owners for extension/sumologic: @aboguszewski-sumo @kkujawa-sumo @mat-rumian @rnishtala-sumo @sumo-drosiek @swiatekm-sumo. See Adding Labels via Comments if you do not have permissions to add labels yourself.

swiatekm commented 6 months ago

@rnishtala-sumo can you have a look? It's a long weekend in Poland and most of us won't have an opportunity to look at this before Monday.

crobert-1 commented 6 months ago

+1 freq: https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/8945973585/job/24575927928

songy23 commented 6 months ago

(Just found this issue, going to close https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/32915)

github-actions[bot] commented 4 months ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

github-actions[bot] commented 2 months ago

This issue has been closed as inactive because it has been stale for 120 days with no activity.