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

Unit Test service/internal/proctelemetry/TestProcessTelemetryWithHostProc failing #11221

Closed
jackgopack4 opened this issue Sep 19, 2024 · 0 comments · Fixed by #11222
Closed
Labels
bug Something isn't working

Comments

@jackgopack4
Copy link
Contributor

jackgopack4 commented Sep 19, 2024

Describe the bug
unit test TestProcess TelemetryWithHostProc is failing for metric name otelcol_process_cpu_seconds

Steps to reproduce
using linux host, run go test inside service/internal/proctelemetry folder

What did you expect to see?
expect tests to pass

What did you see instead?

--- FAIL: TestProcessTelemetryWithHostProc (0.21s)
    process_telemetry_linux_test.go:49: 
                Error Trace:    /home/vscode/otel/opentelemetry-collector/service/internal/proctelemetry/process_telemetry_linux_test.go:49
                Error:          "0" is not greater than "0"
                Test:           TestProcessTelemetryWithHostProc
                Messages:       otelcol_process_cpu_seconds

What version did you use?
upstream main repo

What config did you use?
n/a

Environment
microsoft go 1.23.1 devcontainer in vs code

Additional context
failing in pipeline here: https://github.com/open-telemetry/opentelemetry-collector/actions/runs/10945728350/job/30390637590?pr=11208#step:6:634

It appears that the test is looking for the prefix "process_cpu_seconds" here:

if strings.HasPrefix(metricName, "process_uptime") || strings.HasPrefix(metricName, "process_cpu_seconds") {

all the metrics that it is testing start with otelcol. Will submit a PR to fix this test.

@jackgopack4 jackgopack4 added the bug Something isn't working label Sep 19, 2024
codeboten pushed a commit that referenced this issue Sep 23, 2024
#### Description
Fixes failing unit test TestProcessTelemetryWithHostProc under
service/internal/proctelemetry/process_telemetry_linux_test.go due to
incorrect metric name

#### Link to tracking issue
Fixes [#11221](#11221)
HongChenTW pushed a commit to HongChenTW/opentelemetry-collector that referenced this issue Sep 24, 2024
#### Description
Fixes failing unit test TestProcessTelemetryWithHostProc under
service/internal/proctelemetry/process_telemetry_linux_test.go due to
incorrect metric name

#### Link to tracking issue
Fixes [open-telemetry#11221](open-telemetry#11221)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant