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

Remove deleted pending workloads from the cache so the visibility API results are correct #1679

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

astefanutti
Copy link
Member

@astefanutti astefanutti commented Feb 1, 2024

This fixes #1555 and also adds an integration test as suggested in #1555 (comment).

What type of PR is this?

/kind bug

Which issue(s) this PR fixes:

Fixes #1555

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Remove deleted pending workloads from the cache

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 1, 2024
Copy link

netlify bot commented Feb 1, 2024

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit 38c727b
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/65c10e1b6a3c19000858eef6
😎 Deploy Preview https://deploy-preview-1679--kubernetes-sigs-kueue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 1, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @astefanutti. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Feb 1, 2024
@astefanutti
Copy link
Member Author

/cc @alculquicondor @mimowo

@alculquicondor
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 1, 2024
@alculquicondor
Copy link
Contributor

Is the issue also reflected in ClusterQueue.status? I believe it is. It would be much simpler to test for that and also we could cherry-pick to 0.5.
The visibility server doesn't exist in 0.5, so we can't cherry-pick it.

@mimowo
Copy link
Contributor

mimowo commented Feb 2, 2024

/retest
the failures are due flakes which are now fixed: #1676

@mimowo
Copy link
Contributor

mimowo commented Feb 2, 2024

Is the issue also reflected in ClusterQueue.status? I believe it is. It would be much simpler to test for that and also we could cherry-pick to 0.5.

I think the bug is also impacting the eq.status.pendingWorkloads counter, so we could use this to verify the fix works at the level of integration tests.

pkg/visibility/server.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 5, 2024
Copy link
Contributor

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve
/cherry-pick release-0.5

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 5, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 422ae1db1410c56cdf7baf767f5e564f3e9956de

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, astefanutti

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 Feb 5, 2024
@astefanutti
Copy link
Member Author

Is the issue also reflected in ClusterQueue.status? I believe it is. It would be much simpler to test for that and also we could cherry-pick to 0.5. The visibility server doesn't exist in 0.5, so we can't cherry-pick it.

You're right! I've removed the integration tests for the visibility API, and added a test case to the existing cluster queue controller integration tests, that verifies the fix.

I've kept it as minimal as possible this time, but feel free to suggest any other test cases that you think could be useful to add there.

Copy link
Contributor

@mimowo mimowo left a comment

Choose a reason for hiding this comment

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

/lgtm
Just non-blocking nits to improve readability of the test.
/assign @tenzen-y @alculquicondor

gomega.Expect(k8sClient.Create(ctx, workload)).To(gomega.Succeed())
})

// Pending workloads count is incremented as the workload is inadmissible
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking nit: I would prefer to turn the comment into ginkgo step. Maybe ginkgo.By("await until the pending workload count is incremented as the workload is inadmissible, because the ResourceFlavors don't exist"). This way the comment is also logged, which can make debugging easier.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed. Actually I saw an existing comment and somehow decided to choose that style, but I would have chosen the ginkgo.By stanza otherwise. Let me know if you feel like it's worth I open a follow-up PR.

Copy link
Contributor

@mimowo mimowo Feb 5, 2024

Choose a reason for hiding this comment

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

I didn't notice the PR was approved actually, and thought you would have time to apply the remark.
I'm ok either way, as you feel.

gomega.Expect(k8sClient.Delete(ctx, workload)).To(gomega.Succeed())
})

// Pending workloads count is decrement as the deleted workload has been removed from the queue.
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking nit: same here - turn into ginkgo step

@k8s-ci-robot k8s-ci-robot merged commit bfe4a6b into kubernetes-sigs:main Feb 5, 2024
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.6 milestone Feb 5, 2024
@astefanutti astefanutti deleted the pr-11 branch February 5, 2024 17:01
@alculquicondor
Copy link
Contributor

/cherry-pick release-0.5

@k8s-infra-cherrypick-robot

@alculquicondor: new pull request created: #1686

In response to this:

/cherry-pick release-0.5

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.

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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A pending workload that's deleted is still listed in the visibility API pendingworkloads results
6 participants