open-telemetry / opentelemetry-collector-contrib

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

[receiver/prometheusremotewrite] Flaky test #36654

Open ArthurSens opened 14 hours ago

ArthurSens commented 14 hours ago

Component(s)

receiver/prometheusremotewrite

Describe the issue you're reporting

I've just noticed we have some flaky tests in main: https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/12146357038/job/33870088465

=== FAIL: . TestComponentLifecycle/metrics-lifecycle (0.00s)
    generated_component_test.go:65: 
            Error Trace:    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver/generated_component_test.go:65
            Error:          Received unexpected error:
                            failed to create prometheus remote-write listener: listen tcp 127.0.0.1:9090: bind: address already in use
            Test:           TestComponentLifecycle/metrics-lifecycle

=== FAIL: . TestComponentLifecycle (0.00s)

=== FAIL: . TestHandlePRWContentTypeNegotiation/no_content_type (0.00s)
    receiver_test.go:90: 
            Error Trace:    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver/receiver_test.go:90
            Error:          Received unexpected error:
                            Post "http://localhost:9090/api/v1/write": dial tcp [::1]:9090: connect: connection refused
            Test:           TestHandlePRWContentTypeNegotiation/no_content_type

=== FAIL: . TestHandlePRWContentTypeNegotiation (0.00s)
    receiver_test.go:[43](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/12146357038/job/33870088465#step:7:44): 
            Error Trace:    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver/receiver_test.go:36
                                        /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver/receiver_test.go:43
            Error:          Received unexpected error:
                            failed to create prometheus remote-write listener: listen tcp 127.0.0.1:9090: bind: address already in use
            Test:           TestHandlePRWContentTypeNegotiation
github-actions[bot] commented 14 hours ago

Pinging code owners: