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

Fix testutil metric comparison #497

Merged
merged 2 commits into from
Nov 13, 2018
Merged

Fix testutil metric comparison #497

merged 2 commits into from
Nov 13, 2018

Conversation

beorn7
Copy link
Member

@beorn7 beorn7 commented Nov 13, 2018

Fixes #494.

@philipgough thanks for reporting, please have a look.

@brancz I think the "upstream" code for the testutil package is gone from KSM by now. So no action required there, I guess.

beorn7 added 2 commits November 13, 2018 15:48
Signed-off-by: beorn7 <[email protected]>
reflect.DeepEqual is not suitable for zero occurrences of repeated
proto messages. This changes the comparison to act on the string
representation of proto messages.

Signed-off-by: beorn7 <[email protected]>
@philipgough
Copy link
Contributor

@beorn7 great thanks. That seems to fix the original bug which I had resolved by just using ToFloat64 function. However I also just noticed that the CollectAndCompare function does not seem to work with some other types either.

I can confirm at least a *HistogramVec, has the same behaviour where matching strings are reported unequal. Perhaps it is to do with the DeepEqual on the pointer?

I can update the original issue or open a new one. If the latter then this looks to have resolved the original problem 👍

@beorn7
Copy link
Member Author

beorn7 commented Nov 13, 2018

With this PR, there is no DeepEqual anymore.
I'll merge this, and if you still see problems with this merged, please let me know.

@beorn7 beorn7 merged commit ca9acd2 into master Nov 13, 2018
@beorn7 beorn7 deleted the beorn7/testing branch November 13, 2018 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants