open-telemetry / opentelemetry-collector-contrib

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

[receiver/hostmetricsreceiver] Test failure in internal/scraper/processscraper #36468

Open jade-guiton-dd opened 2 days ago

jade-guiton-dd commented 2 days ago

Component(s)

receiver/hostmetrics

What happened?

Description

When running the tests for receiver/hostmetricsreceiver locally, I consistently get a failure in receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go on lines 179 and 180:

internal.AssertContainsAttribute(t, attr, conventions.AttributeProcessCommand)
internal.AssertContainsAttribute(t, attr, conventions.AttributeProcessCommandLine)

I suspect this may be an OS-dependent issue.

Steps to Reproduce

Run go test in receiver/hostmetricsreceiver.

Expected Result

Tests pass.

Actual Result

Tests fail.

Collector version

Latest main (75ceb559)

Environment information

Environment

OS: macOS Sonoma 14.7.1 (on M3 hardware) Compiler: go 1.22.9

Log output

The following output is repeated many times:

Error:          Should be true
Test:           TestScrape/Enable_memory_utilization
testutils.go:17: 
Error Trace:    [...]/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/testutils.go:17
                [...]/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go:179
                [...]/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go:128
Error:          Should be true
Test:           TestScrape/Enable_memory_utilization
testutils.go:17: 
Error Trace:    [...]/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/testutils.go:17
                [...]/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go:180
                [...]/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go:128
Error:          Should be true
Test:           TestScrape/Enable_memory_utilization

=== FAIL: internal/scraper/processscraper TestScrape (re-run 1) (0.25s)
github-actions[bot] commented 2 days ago

Pinging code owners: