Skip to content

Conversation

@nojnhuh
Copy link
Contributor

@nojnhuh nojnhuh commented Nov 22, 2024

What type of PR is this?

/kind bug
/kind flake

What this PR does / why we need it:

This PR de-flakes the DRA e2e that ensures a ResourceQuota correctly forbids a ResourceClaim that exceeds its defined count/resourceclaims.resource.k8s.io quota. #128410 describes that some flakes occurred where the ResourceClaim was admitted without error, likely due to the API server's cache not being up to date like #128899 simulates. This PR updates the check that newly ResourceClaims are rejected with the expected HTTP 403 message eventually, rather than always as soon as possible on the first try.

Which issue(s) this PR fixes:

Fixes #128410

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/flake Categorizes issue or PR as related to a flaky test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 22, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Details

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Nov 22, 2024
@k8s-ci-robot k8s-ci-robot added area/test sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. wg/device-management Categorizes an issue or PR as relevant to WG Device Management. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 22, 2024
@nojnhuh
Copy link
Contributor Author

nojnhuh commented Nov 22, 2024

/cc @pohly

@k8s-ci-robot k8s-ci-robot requested a review from pohly November 22, 2024 17:47
@jackfrancis
Copy link
Contributor

/retest

@nojnhuh nojnhuh force-pushed the dra-e2e-quota-forbid branch 2 times, most recently from 003495f to 23877fc Compare November 22, 2024 21:06
Copy link
Contributor

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

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

/lgtm

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

LGTM label has been added.

DetailsGit tree hash: 013e96905fd4f88c77aff3f953e124e599ee8ff5

@nojnhuh nojnhuh force-pushed the dra-e2e-quota-forbid branch from 23877fc to c6cfee8 Compare November 24, 2024 17:32
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 24, 2024
@pohly
Copy link
Contributor

pohly commented Nov 25, 2024

/test pull-kubernetes-unit

Because of flake (#128962).

// with an "already exists" error, so use a new name each time.
claim.GenerateName = "claim-1-"
claim.Name = ""
gomega.Eventually(ctx, func() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
gomega.Eventually(ctx, func() error {
gomega.Eventually(ctx, func(ctx context.Context) error {

We should get a new context from gomega.Eventually because that honors the timeout set for gomega.Eventually.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have the appetite to clean up the many instances of gomega.Eventually in the k/k codebase that are not using context properly? (there are a lot! :/)

Let me know if there are any SIGs in particular that have an appetite for this and I'd be happy to drive that work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have the appetite to clean up the many instances of gomega.Eventually in the k/k codebase that are not using context properly?

I don't, but I will point it out in new code when I spot it. OTOH, such a search/replace should be safe, so why not?

The biggest issue is that even if we clean up once, developers will keep adding this back unless we provide some linter which warns about this. Reviewers do not always spot this. Such a linter would be more work.

Let me know if there are any SIGs in particular that have an appetite for this

I'd say "writing better tests" falls under SIG Testing and I've been the TL there who did most of that work in the last years.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use this PR as a reference, then after it merges I'll submit a PR that cleans up similar usage gaps in the codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should get a new context from gomega.Eventually because that honors the timeout set for gomega.Eventually.

Just pushed this change.

@nojnhuh nojnhuh force-pushed the dra-e2e-quota-forbid branch from c6cfee8 to 05ebf45 Compare November 25, 2024 18:33
Copy link
Contributor

@pohly pohly 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

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

LGTM label has been added.

DetailsGit tree hash: 698cd3862abc7c9a9c74b121793841aaf23e1fdc

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jackfrancis, nojnhuh, pohly

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 26, 2024
@k8s-ci-robot k8s-ci-robot merged commit 95d4813 into kubernetes:master Dec 12, 2024
22 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.33 milestone Dec 12, 2024
@nojnhuh nojnhuh deleted the dra-e2e-quota-forbid branch December 12, 2024 05:29
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. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/flake Categorizes issue or PR as related to a flaky test. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. wg/device-management Categorizes an issue or PR as relevant to WG Device Management.

Projects

Status: Done
Archived in project

Development

Successfully merging this pull request may close these issues.

Failure cluster [e15e458b...]: cluster supports count/resourceclaims.resource.k8s.io ResourceQuota

4 participants