-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Add pod_swap_usage_bytes
as an expected metric in resource metric e2e test
#119421
Add pod_swap_usage_bytes
as an expected metric in resource metric e2e test
#119421
Conversation
Hi @iholder101. 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. |
27e07f7
to
683e36a
Compare
/sig node |
/ok-to-test |
/assign |
/test pull-kubernetes-cos-cgroupv1-containerd-node-e2e-features |
683e36a
to
bbd9786
Compare
/test pull-kubernetes-cos-cgroupv1-containerd-node-e2e-features |
bbd9786
to
a4f8892
Compare
Tests pass and PR is ready to review. PTAL. Changes summary: However, I wanted to keep ensuring that all of the other metrics are always reported. Therefore, I've explicitly ensured they were reported by using |
@@ -165,3 +165,18 @@ func boundedSample(lower, upper interface{}) types.GomegaMatcher { | |||
"Histogram": gstruct.Ignore(), | |||
})) | |||
} | |||
|
|||
func haveKeys(keys ...string) types.GomegaMatcher { | |||
gomega.Expect(keys).ToNot(gomega.BeEmpty()) |
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'd use ExpectWithOffset
- not sure if there's a better method mark this function as helper
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.
Thanks, done 👍
@@ -73,7 +73,7 @@ var _ = SIGDescribe("ResourceMetricsAPI [NodeFeature:ResourceMetrics]", func() { | |||
memoryCapacity := node.Status.Capacity["memory"] | |||
memoryLimit := memoryCapacity.Value() | |||
|
|||
matchResourceMetrics := gstruct.MatchAllKeys(gstruct.Keys{ | |||
matchResourceMetrics := gomega.And(gstruct.MatchKeys(gstruct.IgnoreMissing, gstruct.Keys{ |
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.
how hard is to detect if the swap is neabled in the node programmatically, and just use different MatchAllKeys
in the two flows?
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 guess we can fix the failure and iterate later
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 don't know of an easy way to do so.
Even if NodeSwap
feature-gate is enabled, it doesn't mean that the node actually has swap provisioned on it. We could always try to find the node that the pod runs on and try executing stuff on it to find this out, but I think it's a big enough complication.
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 guess we can fix the failure and iterate later
Sounds good to me 👍 Thanks!
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.
thinking aloud, maybe we can use swapon
? Anyway, the more I think about it the more it seems wiser to fix the burning issue and improve later, the current approach seems good enough for the time being.
If you resubmit for whatever reason, please add a copy of this content #119421 (comment) as code comment right above the gomega.And
Signed-off-by: Itamar Holder <iholder@redhat.com>
Use haveKeys() matcher from previous commit to ensure required keys exist. Signed-off-by: Itamar Holder <iholder@redhat.com>
0d74030
to
ee82654
Compare
/test pull-kubernetes-cos-cgroupv1-containerd-node-e2e-features |
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
LGTM label has been added. Git tree hash: cfdeabac715824bb51bbbfc184c67161945e9947
|
/test pull-kubernetes-e2e-kind |
/assign @SergeyKanzhelev @mrunalp |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: iholder101, SergeyKanzhelev 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 |
/milestone v1.28 |
The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass. This bot retests PRs for certain kubernetes repos according to the following rules:
You can:
/retest |
https://prow.k8s.io/job-history/gs/kubernetes-jenkins/logs/ci-crio-cgroupv1-node-e2e-features test failures(7 today) link |
What type of PR is this?
/kind cleanup
/kind failing-test
What this PR does / why we need it:
Recently, swap stats were added to
/stats/summary
and/metrics/resource
.These changes caused the
ResourceMetricsAPI
e2e test to fail at periodic jobs [1], that do not expect thepod_swap_usage_bytes
metric.This PR adds expectation for
pod_swap_usage_bytes
metric to the test, which will now cause it to pass.[1] https://testgrid.k8s.io/sig-node-cri-o#ci-crio-cgroupv1-node-e2e-features
Which issue(s) this PR fixes:
Fixes #119400
Special notes for your reviewer:
Does this PR introduce a user-facing change?