-
Notifications
You must be signed in to change notification settings - Fork 42.1k
e2e: wrap DRA ResourceQuota Forbidden claim check in gomega.Eventually #128943
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
Conversation
|
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The DetailsInstructions 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. |
|
/cc @pohly |
|
/retest |
003495f to
23877fc
Compare
jackfrancis
left a comment
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. DetailsGit tree hash: 013e96905fd4f88c77aff3f953e124e599ee8ff5 |
23877fc to
c6cfee8
Compare
|
/test pull-kubernetes-unit Because of flake (#128962). |
test/e2e/dra/dra.go
Outdated
| // with an "already exists" error, so use a new name each time. | ||
| claim.GenerateName = "claim-1-" | ||
| claim.Name = "" | ||
| gomega.Eventually(ctx, func() error { |
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.
| 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.
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.
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.
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.
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.
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.
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.
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.
We should get a new context from
gomega.Eventuallybecause that honors the timeout set forgomega.Eventually.
Just pushed this change.
c6cfee8 to
05ebf45
Compare
pohly
left a comment
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. DetailsGit tree hash: 698cd3862abc7c9a9c74b121793841aaf23e1fdc |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.ioquota. #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?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: