open-telemetry / opentelemetry-collector-contrib

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

[receiver/kubeletstats] Failing test: TestScraperWithNodeUtilization #33681

Open crobert-1 opened 1 week ago

crobert-1 commented 1 week ago

Component(s)

receiver/kubeletstats

Describe the issue you're reporting

Failing CI/CD action

Failure output:

=== RUN   TestScraperWithNodeUtilization
    scraper_test.go:139: 
            Error Trace:    /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver/scraper_test.go:139
            Error:          Not equal: 
                            expected: 18
                            actual  : 0
            Test:           TestScraperWithNodeUtilization
--- FAIL: TestScraperWithNodeUtilization (0.00s)
github-actions[bot] commented 1 week ago

Pinging code owners:

ChrsMark commented 1 week ago

I suspect this might be a timing issue with the node Informer, which is based on fake k8s client, not being updated fast enough before the first scrape.

Filed https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/33685 to ensure that the assertion of the metrics happens after a first valid scrape. Hopefully this will cover the flakiness here.