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

Clarify VPA logging #2496

Merged
merged 3 commits into from
Nov 4, 2019
Merged

Conversation

jbartosik
Copy link
Collaborator

No description provided.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 30, 2019
ginkgo.By("Verifying hamster deployment")
for i, pod := range podList.Items {
podInfo := fmt.Sprintf("pod at index %d", i)
cpuDescription := fmt.Sprintf("%s: originally Pods had 100m CPU, admission controller should change it to recommended 250m CPU", podInfo)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the values into variables, so that we don't have to modify multiple places.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

gomega.Expect(pod.Spec.Containers[0].Resources.Requests[apiv1.ResourceMemory]).To(gomega.Equal(ParseQuantityOrDie("200Mi")))
ginkgo.By("Verifying hamster deployment")
for i, pod := range podList.Items {
podInfo := fmt.Sprintf("pod at index %d", i)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just pod.Name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add pod.Name but I want to keep pod index too. If the check always fails for pod with index 0 then likely always all pods would fail the check. If the check sometimes fails for pod with a higher index then we know that the problem can affect only some of pods in a deployment.

Copy link
Member

@bskiba bskiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIR, the Expect will already say:
expected: this much,
got: this much

I think the only piece missing here for clarity is what we are this value of.
So I would much rather see a message that says for example "pod sth: resource request incorrect" or "pod sth: cpu limit ratio incorrect (not capped to limitrange max)"

I might remember wrong though. WDYT?

@jbartosik
Copy link
Collaborator Author

AFAIR, the Expect will already say:
expected: this much,
got: this much

I think the only piece missing here for clarity is what we are this value of.
So I would much rather see a message that says for example "pod sth: resource request incorrect" or "pod sth: cpu limit ratio incorrect (not capped to limitrange max)"

I might remember wrong though. WDYT?

Errors look like:

Expected
    <resource.Quantity>: {
        i: {value: 100, scale: -3},
        d: {Dec: nil},
        s: "100m",
        Format: "DecimalSI",
    }
to equal
    <resource.Quantity>: {
        i: {value: 200, scale: -3},
        d: {Dec: nil},
        s: "200m",
        Format: "DecimalSI",
    }

For me it wasn't clear which is the actual value and which is expected value.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 30, 2019
@jbartosik jbartosik mentioned this pull request Oct 31, 2019
@bskiba
Copy link
Member

bskiba commented Oct 31, 2019

Expected to equal seems quite clear to me (although it's the other way round than I remembered). I don't want to add too much there since the code gets cluttered IMO.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2019
@jbartosik
Copy link
Collaborator Author

Expected to equal seems quite clear to me (although it's the other way round than I remembered). I don't want to add too much there since the code gets cluttered IMO.

Order isn't the only information missing from the log. It's also not saying what those values are (limit or request). I think we should log more details about the failure, looking it up in test code is painful.

I added another commit, reducing amount of cluter a bit while trying to preserve most of information

I was debugging some test failures and found the logs not clear enough.
Move explanation of expectations from comments to logged description.
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2019
@jbartosik
Copy link
Collaborator Author

/hold
Rebased to resolve merge conflicts, putting on hold while I rerun tests.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2019
@jbartosik
Copy link
Collaborator Author

/hold cancel

Tests seem to work after rebase

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2019
@bskiba
Copy link
Member

bskiba commented Nov 4, 2019

Thanks a lot, this looks really good
/lgtm
/apprive

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 4, 2019
@bskiba
Copy link
Member

bskiba commented Nov 4, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bskiba

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 4, 2019
@k8s-ci-robot k8s-ci-robot merged commit ded3b30 into kubernetes:master Nov 4, 2019
@jbartosik jbartosik deleted the clarify-e2e-logs branch January 15, 2021 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants