-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[processor/deltatocumulativeprocessor] Adjust equal test to not compare functions #38008
Conversation
…compare iterators
I don't think this needs a changelog entry so I appreciate if a mantainer can add the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting. Looking at this, I think there is little value in comparing returned funcs at all (whether they are iterators or not). how about we skip them altogether?
Fair point, I will do that. |
@open-telemetry/collector-contrib-approvers this is ready to merge |
Description
With the collector now on Go 1.23 I'm working on adding iterator support for pdata at open-telemetry/opentelemetry-collector#12380 but the EqualT_test fails when comparing the iterators returned by All.
Since the reflect value of an iter.Seq/iter.Seq2 is reflect.Func, they are not comparable in the usual sense. The go-cmp/cmp is still on Go 1.21 so it does not know about iterators. There is
x/exp/xiter.Equal
but it is still an open proposal.See https://go.googlesource.com/go/+/81c66e71d480ae2372b7eea4bcdf600b50fdd5e1/src/reflect/deepequal.go#158.
Examples of the test failures:
This PR adjusts the equal logic to skip the equality check for functions.
Link to tracking issue
For open-telemetry/opentelemetry-collector#12380