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

[receiver/prometheus] Unit test failure: TestScopeInfoScopeAttributes #26123

Closed
crobert-1 opened this issue Aug 28, 2023 · 2 comments · Fixed by #26240
Closed

[receiver/prometheus] Unit test failure: TestScopeInfoScopeAttributes #26123

crobert-1 opened this issue Aug 28, 2023 · 2 comments · Fixed by #26240
Assignees
Labels
flaky test a test is flaky receiver/prometheus Prometheus receiver

Comments

@crobert-1
Copy link
Member

Component(s)

receiver/prometheus

Describe the issue you're reporting

CI failure link

Test failure output:

    --- FAIL: TestScopeInfoScopeAttributes/target1 (0.00s)
        metrics_receiver_labels_test.go:771: 
            	Error Trace:	/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/prometheusreceiver/metrics_receiver_labels_test.go:771
            	            				/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/prometheusreceiver/metrics_receiver_helper_test.go:652
            	Error:      	Not equal: 
            	            	expected: "scope.with.attributes"
            	            	actual  : "fake.scope.name"
            	            	
            	            	Diff:
            	            	--- Expected
            	            	+++ Actual
            	            	@@ -1 +1 @@
            	            	-scope.with.attributes
            	            	+fake.scope.name
            	Test:       	TestScopeInfoScopeAttributes/target1
FAIL
	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver	coverage: 54.5% of statements
FAIL	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver	242.654s
ok  	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver/internal	7.224s	coverage: 90.5% of statements
FAIL
make[2]: *** [../../Makefile.Common:105: test-with-cover] Error 1

This is a new test, added in PR #25898. It appears as if the test data may not preserve the ordering it's defined in, so we check for what we expect to be the first scope name, but it's actually the second defined value. It seems to be parsing data properly. I think the test just needs to be updated to properly account for un-ordered data, or sort the data somehow before checking values.

@crobert-1 crobert-1 added the needs triage New item requiring triage label Aug 28, 2023
@github-actions github-actions bot added the receiver/prometheus Prometheus receiver label Aug 28, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

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

@dashpole dashpole self-assigned this Aug 28, 2023
@dashpole dashpole added flaky test a test is flaky and removed needs triage New item requiring triage labels Aug 28, 2023
@dashpole
Copy link
Contributor

I'll get this fixed. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky test a test is flaky receiver/prometheus Prometheus receiver
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants