[chore][pkg/stanza] - Fix Flaky test TestMatcher#36640
Merged
Merged
Conversation
evan-bradley
approved these changes
Dec 3, 2024
Contributor
evan-bradley
left a comment
There was a problem hiding this comment.
Nice catch, thanks.
adrielp
approved these changes
Dec 3, 2024
Contributor
Author
|
cc: @odubajDT can you take a look? this is related to your recent work on file groupings. |
shivanthzen
pushed a commit
to shivanthzen/opentelemetry-collector-contrib
that referenced
this pull request
Dec 5, 2024
Fixes open-telemetry#36623 We're using a map to store groups and we then do a `for .. range` over keys. https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/6119d51a5a85565c409bb225027d6d1ab353aecc/pkg/stanza/fileconsumer/matcher/matcher.go#L200-L206 For maps, the ordering of keys is not guaranteed. Hence, the check fails. We should instead check with `assert.ElementsMatch` (which was previously the case, but open-telemetry#36518 changed it to `assert.Equal`)
ZenoCC-Peng
pushed a commit
to ZenoCC-Peng/opentelemetry-collector-contrib
that referenced
this pull request
Dec 6, 2024
Fixes open-telemetry#36623 We're using a map to store groups and we then do a `for .. range` over keys. https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/6119d51a5a85565c409bb225027d6d1ab353aecc/pkg/stanza/fileconsumer/matcher/matcher.go#L200-L206 For maps, the ordering of keys is not guaranteed. Hence, the check fails. We should instead check with `assert.ElementsMatch` (which was previously the case, but open-telemetry#36518 changed it to `assert.Equal`)
sbylica-splunk
pushed a commit
to sbylica-splunk/opentelemetry-collector-contrib
that referenced
this pull request
Dec 17, 2024
Fixes open-telemetry#36623 We're using a map to store groups and we then do a `for .. range` over keys. https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/6119d51a5a85565c409bb225027d6d1ab353aecc/pkg/stanza/fileconsumer/matcher/matcher.go#L200-L206 For maps, the ordering of keys is not guaranteed. Hence, the check fails. We should instead check with `assert.ElementsMatch` (which was previously the case, but open-telemetry#36518 changed it to `assert.Equal`)
AkhigbeEromo
pushed a commit
to sematext/opentelemetry-collector-contrib
that referenced
this pull request
Jan 13, 2025
Fixes open-telemetry#36623 We're using a map to store groups and we then do a `for .. range` over keys. https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/6119d51a5a85565c409bb225027d6d1ab353aecc/pkg/stanza/fileconsumer/matcher/matcher.go#L200-L206 For maps, the ordering of keys is not guaranteed. Hence, the check fails. We should instead check with `assert.ElementsMatch` (which was previously the case, but open-telemetry#36518 changed it to `assert.Equal`)
zeck-ops
pushed a commit
to zeck-ops/opentelemetry-collector-contrib
that referenced
this pull request
Apr 23, 2025
Fixes open-telemetry#36623 We're using a map to store groups and we then do a `for .. range` over keys. https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/6119d51a5a85565c409bb225027d6d1ab353aecc/pkg/stanza/fileconsumer/matcher/matcher.go#L200-L206 For maps, the ordering of keys is not guaranteed. Hence, the check fails. We should instead check with `assert.ElementsMatch` (which was previously the case, but open-telemetry#36518 changed it to `assert.Equal`)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #36623
We're using a map to store groups and we then do a
for .. rangeover keys.opentelemetry-collector-contrib/pkg/stanza/fileconsumer/matcher/matcher.go
Lines 200 to 206 in 6119d51
For maps, the ordering of keys is not guaranteed. Hence, the check fails.
We should instead check with
assert.ElementsMatch(which was previously the case, but #36518 changed it toassert.Equal)