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
storage/etcd3/metrics: add unit test for apiserver_storage_objects #120827
storage/etcd3/metrics: add unit test for apiserver_storage_objects #120827
Conversation
Hi @machine424. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
cc @dgrisonnet |
t.Run(test.desc, func(t *testing.T) { | ||
defer registry.Reset() | ||
UpdateObjectCount(test.resource, test.count) | ||
if err := testutil.GatherAndCompare(registry, strings.NewReader(test.want), testedMetrics); err != nil { |
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.
I find the GatherAndCompare
check error-prone as it always passes if the metric isn't present, I don't know what you think
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.
@dgrisonnet - seems like something we want to fix there ^^
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.
Yeah that's definitely something that should be fixed. Great find @machine424 👍
The testutil function we have is just a wrapper around the function in client_golang, so we would have to fix it there: https://github.com/prometheus/client_golang/blob/1bae6c1e6314f6a20be183a7277059630780232a/prometheus/testutil/testutil.go#L201-L203
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.
Cool, now that we agree that this can be improved, I can check with client_golang folks (I think this was introduced here https://github.com/prometheus/client_golang/pull/1143/files), independently of this PR.
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.
Created an issue prometheus/client_golang#1351
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.
As I said the issue prometheus/client_golang#1351 is not a prerequisite, we can try to merge this without.
/triage accepted |
/sig instrumentation |
/assign @dgrisonnet |
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.
/lgtm
/approve
LGTM label has been added. Git tree hash: 8482da0b07c9dbe082d09b320a1e526a6bc2939b
|
/ok-to-test |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: logicalhan, machine424 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@machine424: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/kind cleanup |
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
#120597 follow-up
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: